]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix out of bounds memory access on -n option
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 18 Jul 2014 11:51:17 +0000 (04:51 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 18 Jul 2014 11:51:17 +0000 (04:51 -0700)
src/main.cc

index e07028552dbd442acde655fb0968f0c0d6b9d997..b87099b8fbafe16f7ab716eba39a64f518f0d512 100644 (file)
@@ -507,7 +507,7 @@ mainParseOptions(int argc, char *argv[])
             /** \par n
              * Set global option opt_signal_service (to true).
              * Stores the additional parameter given in global service_name */
-            if (optarg || *optarg == '\0') {
+            if (optarg && *optarg != '\0') {
                 const SBuf t(optarg);
                 ::Parser::Tokenizer tok(t);
                 const CharacterSet chr = CharacterSet::ALPHA+CharacterSet::DIGIT;