diff options
Diffstat (limited to 'src/request.c')
-rw-r--r-- | src/request.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/request.c b/src/request.c index a48bf48..e76a98f 100644 --- a/src/request.c +++ b/src/request.c @@ -241,9 +241,11 @@ static int http_request_split_value(array *vals, buffer *b) { start = s; for (; *s != ',' && i < b->used - 1; i++, s++); + if (start == s) break; /* empty fields are skipped */ end = s - 1; - for (; (*end == ' ' || *end == '\t') && end > start; end--); + for (; end > start && (*end == ' ' || *end == '\t'); end--); + if (start == end) break; /* empty fields are skipped */ if (NULL == (ds = (data_string *)array_get_unused_element(vals, TYPE_STRING))) { ds = data_string_init(); |