Permalink
Browse files

Fixed stack-based buffer overflow (private e-mail from Mitsunari)

  • Loading branch information...
Cristy
Cristy committed Nov 10, 2017
1 parent 9798028 commit 56c5a25c74872baef51549bc8f1ef4a68e5b7274
Showing with 1 addition and 1 deletion.
  1. +1 −1 coders/txt.c
View
@@ -440,7 +440,7 @@ static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
height=0;
max_value=0;
*colorspace='\0';
count=(ssize_t) sscanf(text+32,"%lu,%lu,%lu,%s",&width,&height,&max_value,
count=(ssize_t) sscanf(text+32,"%lu,%lu,%lu,%32s",&width,&height,&max_value,
colorspace);
if ((count != 4) || (width == 0) || (height == 0) || (max_value == 0))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");

0 comments on commit 56c5a25

Please sign in to comment.