소스 검색

fix overflow

Nicolas Cannasse 7 년 전
부모
커밋
b7df6c3ede
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/std/ucs2.c

+ 1 - 1
src/std/ucs2.c

@@ -213,7 +213,7 @@ sprintf_loop:
 						if( i != 2 ) hl_fatal("Unsupported printf format"); // no support for precision qualifier
 						{
 							uchar *s = va_arg(arglist,uchar *);
-							while( *s )
+							while( *s && out < end )
 								*out++ = *s++;
 							goto sprintf_loop;
 						}