Explorar el Código

digestauth: do not allocate extra space for extended notation

Evgeny Grin (Karlson2k) hace 3 años
padre
commit
c7ac9d80a5
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/microhttpd/digestauth.c

+ 2 - 1
src/microhttpd/digestauth.c

@@ -680,7 +680,8 @@ get_rq_unames_size (const struct MHD_RqDAuth *params,
       s += (params->username.value.len + 1) / 2;
   }
   else if (MHD_DIGEST_AUTH_UNAME_TYPE_EXTENDED == uname_type)
-    s += params->username_ext.value.len + 1; /* Add one byte for zero-termination */
+    s += params->username_ext.value.len
+         - MHD_DAUTH_EXT_PARAM_MIN_LEN + 1; /* Add one byte for zero-termination */
   return s;
 }