Commit 0fb3baff authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Clean up assertions in http_hdr_flags()

The input argument assertions and checks in http_hdr_flags() were
misleading and lacking. With this patch it returns (NULL) on either input
being NULL, and also when called with an empty string instead of
asserting.
parent 19544fdc
......@@ -140,9 +140,9 @@ http_hdr_flags(const char *b, const char *e)
unsigned u;
struct http_hdrflg *retval;
if (e == NULL)
return(NULL);
assert(e > b);
if (b == NULL || e == NULL)
return (NULL);
assert(b <= e);
u = (unsigned)(e - b);
assert(b + u == e);
if (u < 2 || u > 19) // MIN_WORD_LENGTH & MAX_WORD_LENGTH
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment