summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2014-02-24 02:17:08 +0100
committerDirk Engling <erdgeist@erdgeist.org>2014-02-24 02:17:08 +0100
commit86a9ddecb6e3dc0063ea2cc56576ba7c7934b400 (patch)
treecf1433bdcbb4b3ec17ef4205731cff287ead4a6c
parenta0fba290f03b9d3d4327dd01d56d8f79f08951c5 (diff)
Check parameter count before using argv
-rw-r--r--src/export/extract_version_3.c5
1 files changed, 4 insertions, 1 deletions
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 @@
10#define HUGEBLOCK (1024*1024) 10#define HUGEBLOCK (1024*1024)
11 11
12int main(int argc, char **argv) { 12int main(int argc, char **argv) {
13 MAP in = map_file( argv[1], 1 ); 13 MAP in;
14
15 if( argc != 2 ) exit(111);
16 in = map_file( argv[1], 1 );
14 17
15 unsigned const char xorkey [XORLEN] = "Just for Fun. Linus Torvalds."; 18 unsigned const char xorkey [XORLEN] = "Just for Fun. Linus Torvalds.";
16 unsigned char input [XORLEN]; 19 unsigned char input [XORLEN];