]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: ECH param parsing refix
authorsftcd <stephen.farrell@cs.tcd.ie>
Wed, 15 Jan 2025 12:47:41 +0000 (12:47 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 Jan 2025 08:17:01 +0000 (09:17 +0100)
Regression.

Fixes #16006
Reported-by: Milon Renatus
Closes #16010

src/tool_getparam.c

index 5eb37945193a5a81cc12dd91674d20860adb5df4..eb54d707a0a79fd7693445938e5d67515c3be639 100644 (file)
@@ -1132,13 +1132,11 @@ static ParameterError parse_ech(struct GlobalConfig *global,
     err = PARAM_LIBCURL_DOESNT_SUPPORT;
   else if(strlen(nextarg) > 4 && strncasecompare("pn:", nextarg, 3)) {
     /* a public_name */
-    nextarg += 3;
     err = getstr(&config->ech_public, nextarg, DENY_BLANK);
   }
   else if(strlen(nextarg) > 5 && strncasecompare("ecl:", nextarg, 4)) {
     /* an ECHConfigList */
-    nextarg += 4;
-    if('@' != *nextarg) {
+    if('@' != *(nextarg + 4)) {
       err = getstr(&config->ech_config, nextarg, DENY_BLANK);
     }
     else {
@@ -1146,7 +1144,7 @@ static ParameterError parse_ech(struct GlobalConfig *global,
       char *tmpcfg = NULL;
       FILE *file;
 
-      nextarg++;        /* skip over '@' */
+      nextarg += 5;        /* skip over 'ecl:@' */
       if(!strcmp("-", nextarg)) {
         file = stdin;
       }