Fix crashing when accessing out of global arrays

This commit is contained in:
Pali Rohár committed 2013-01-05 12:11:03 +01:00
1 parent 9ea9bea096
commit e362f3cab9
3 files changed
+4 -5

No files matched your search

+1 -2
View File
@@ -300,7 +300,7 @@ static const char * image_tmp[] = {
static const char * image_tmp_name(enum image_type type) {
if ( type > sizeof(image_tmp)/sizeof(image_tmp[0]) )
if ( type >= sizeof(image_tmp)/sizeof(image_tmp[0]) )
return NULL;
if ( ! image_tmp[type] || ! image_tmp[type][0] )
@@ -1288,7 +1288,6 @@ int main(int argc, char **argv) {
}
}
}