From a8f752130bc98a2b6f2db93520b6038f2180c774 Mon Sep 17 00:00:00 2001 From: Sean Qureshi Date: Sun, 4 Aug 2013 14:36:09 -0700 Subject: Fixed 2 Null pointer derefrences in both nTox and toxic --- testing/nTox.c | 4 +++- testing/toxic/main.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'testing') diff --git a/testing/nTox.c b/testing/nTox.c index 072c17e3..ec597bc3 100644 --- a/testing/nTox.c +++ b/testing/nTox.c @@ -428,7 +428,9 @@ int main(int argc, char *argv[]) } for(i = 0; i < argc; i++) { - if(argv[i][0] == '-') { + if (argv[i] == NULL){ + break; + } else if(argv[i][0] == '-') { if(argv[i][1] == 'h') { print_help(); exit(0); diff --git a/testing/toxic/main.c b/testing/toxic/main.c index e0e23708..45760b1c 100644 --- a/testing/toxic/main.c +++ b/testing/toxic/main.c @@ -288,7 +288,9 @@ int main(int argc, char* argv[]) { ToxWindow* a; for(i = 0; i < argc; i++) { - if(argv[i][0] == '-') { + if (argv[i] == NULL){ + break; + } else if(argv[i][0] == '-') { if(argv[i][1] == 'f') { if(argv[i + 1] != NULL) filename = argv[i + 1]; -- cgit v1.2.3