Commit 2df5b068 authored by Slava Monich's avatar Slava Monich

Merge pull request #35 from monich/empty-string

Handle empty header values
parents 05654fe7 b8a79da6
......@@ -473,6 +473,13 @@ static const char *decode_text(struct wsp_header_iter *iter)
const unsigned char *p;
unsigned int l;
if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_LONG) {
if (iter->len == 0) /* The only way to encode an empty string */
return (char*)(iter->pdu + iter->pos - 1);
return NULL;
}
if (wsp_header_iter_get_val_type(iter) != WSP_VALUE_TYPE_TEXT)
return NULL;
......
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