From: Amos Jeffries Date: Fri, 18 Jul 2014 11:51:17 +0000 (-0700) Subject: Fix out of bounds memory access on -n option X-Git-Tag: SQUID_3_5_0_1~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eeae173325b68f2e4484a0c5ce8e6d2c230ff560;p=thirdparty%2Fsquid.git Fix out of bounds memory access on -n option --- diff --git a/src/main.cc b/src/main.cc index e07028552d..b87099b8fb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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;