1
0
Fork 0
mirror of https://libwebsockets.org/repo/libwebsockets synced 2025-08-25 17:50:33 +00:00

Subject: [PATCH] Fix cgi QUERY_STRING key only field truncated

A request like 'http://host?abc' set the QUERY_STRING variable for CGIs
to "ab" instead of "abc". This was because the code didn't account for
key-only fields, only for key-value ones.
This commit is contained in:
Albert Ribes 2025-04-07 12:28:09 +02:00 committed by Andy Green
commit 9a9ab2865b

View file

@ -257,7 +257,7 @@ lws_cgi_via_info(struct lws_cgi_info * cgiinfo)
if (*t == '=')
*p++ = *t++;
i = urlencode(t, i - lws_ptr_diff(t, tok), p, lws_ptr_diff(end, p));
if (i > 0) {
if (i >= 0) {
p += i;
*p++ = '&';
}