]> granicus.if.org Git - curl/commitdiff
curl: --local-port range was not "including"
authorDaniel Stenberg <daniel@haxx.se>
Fri, 9 Nov 2018 09:49:14 +0000 (10:49 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 9 Nov 2018 21:34:14 +0000 (22:34 +0100)
The end port number in a given range was not included in the range used,
as it is documented to be.

Reported-by: infinnovation-dev on github
Fixes #3251
Closes #3255

src/tool_getparam.c

index 5dc4141faddbfab443e216b5c8dec5e48ab24849..4e06cd61ea4a691730f1e16c9c2ac7f4ec850623 100644 (file)
@@ -958,7 +958,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
           err = str2unum(&config->localportrange, lrange);
           if(err || (config->localportrange > 65535))
             return PARAM_BAD_USE;
-          config->localportrange -= config->localport;
+          config->localportrange -= (config->localport-1);
           if(config->localportrange < 1)
             return PARAM_BAD_USE;
         }