]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4429: http(s)_port options= error message missing characters
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 9 Feb 2016 13:35:45 +0000 (02:35 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 9 Feb 2016 13:35:45 +0000 (02:35 +1300)
src/security/PeerOptions.cc

index 4861d0f4b9e0d28e6601884c1e8cfb7735bee3f6..5f21437d3f083900744209a34df84d0a3468e0fc 100644 (file)
@@ -430,12 +430,9 @@ Security::PeerOptions::parseOptions()
         SBuf option;
         long value = 0;
 
-        if (tok.int64(hex, 16, false)) {
-            /* Special case.. hex specification */
-            value = hex;
-        }
+        // Bug 4429: identify the full option name before determining text or numeric
+        if (tok.prefix(option, optChars)) {
 
-        else if (tok.prefix(option, optChars)) {
             // find the named option in our supported set
             for (struct ssl_option *opttmp = ssl_options; opttmp->name; ++opttmp) {
                 if (option.cmp(opttmp->name) == 0) {
@@ -443,6 +440,12 @@ Security::PeerOptions::parseOptions()
                     break;
                 }
             }
+
+            // Special case.. hex specification
+            ::Parser::Tokenizer tmp(option);
+            if (!value && tmp.int64(hex, 16, false) && tmp.atEnd()) {
+                value = hex;
+            }
         }
 
         if (value) {