(setnmap): make sure strchr returned a string [CID-65]
authorLove Hornquist Astrand <lha@h5l.org>
Thu, 30 Jul 2009 11:00:34 +0000 (13:00 +0200)
committerLove Hornquist Astrand <lha@h5l.org>
Thu, 30 Jul 2009 11:00:34 +0000 (13:00 +0200)
appl/ftp/ftp/cmds.c

index 43842c8de405dfab9216b2db8e35fb1f8c73b915..0c1355a8eee6c56f7f4952e389d04742e121d14c 100644 (file)
@@ -1759,6 +1759,11 @@ setnmap(int argc, char **argv)
        mapflag = 1;
        code = 1;
        cp = strchr(altarg, ' ');
+       if (cp == NULL) {
+               printf("Usage: %s missing space\n",argv[0]);
+               code = -1;
+               return;
+       }
        if (proxy) {
                while(*++cp == ' ')
                        continue;