From e362f3cab9b58af81db4177104eacd806febf2c9 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sat, 5 Jan 2013 12:11:03 +0100 Subject: Fix crashing when accessing out of global arrays --- src/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 3616470..e5c71ae 100644 --- a/src/main.c +++ b/src/main.c @@ -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) { } - } } -- cgit v1.2.3