tiffset: check memory allocation

fixes #157 / http://bugzilla.maptools.org/show_bug.cgi?id=2850
This commit is contained in:
Thomas Bernard 2020-03-23 17:17:17 +01:00
parent 443bd37f65
commit b738aaa834
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -343,6 +343,12 @@ main(int argc, char* argv[])
}
text = (char *) malloc(1000000);
if(text == NULL) {
fprintf( stderr,
"Memory allocation error\n");
fclose( fp );
continue;
}
len = fread( text, 1, 999999, fp );
text[len] = '\0';