From 86a9ddecb6e3dc0063ea2cc56576ba7c7934b400 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 24 Feb 2014 02:17:08 +0100 Subject: Check parameter count before using argv --- src/export/extract_version_3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/export/extract_version_3.c b/src/export/extract_version_3.c index fef4241..19df167 100644 --- a/src/export/extract_version_3.c +++ b/src/export/extract_version_3.c @@ -10,7 +10,10 @@ #define HUGEBLOCK (1024*1024) int main(int argc, char **argv) { - MAP in = map_file( argv[1], 1 ); + MAP in; + + if( argc != 2 ) exit(111); + in = map_file( argv[1], 1 ); unsigned const char xorkey [XORLEN] = "Just for Fun. Linus Torvalds."; unsigned char input [XORLEN]; -- cgit v1.2.3