diff options
context:
space:
mode:
Diffstat (limited to 'source/html.c')
-rw-r--r--source/html.c4
1 file changed, 3 insertions, 1 deletion
diff --git a/source/html.c b/source/html.c
index b97fdbb..5972d97 100644
--- a/source/html.c
+++ b/source/html.c
@@ -394,8 +394,10 @@ void http_parse_querystring(const char *txt, void (*fn)(const char *name, const
while (p && *p) {
char *name = url_decode_parameter_name(&p);
+ // A name ends at an equals sign or an ampersand, and only the
+ // first is followed by a value.
if (*name) {
- char *value = url_decode_parameter_value(&p);
+ char *value = p[-1] == '=' ? url_decode_parameter_value(&p) : xstrdup("");
fn(name, value);
free(value);
}