lws_reset_header_table dont reset NULL
authorAndy Green <andy.green@linaro.org>
Tue, 9 Feb 2016 01:15:02 +0000 (09:15 +0800)
committerAndy Green <andy.green@linaro.org>
Tue, 9 Feb 2016 01:15:02 +0000 (09:15 +0800)
This is only a temporary, fragile solution.

https://github.com/warmcat/libwebsockets/issues/416

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/parsers.c

index 8de7686..d556b9f 100644 (file)
@@ -63,6 +63,9 @@ lextable_decode(int pos, char c)
 void
 lws_reset_header_table(struct lws *wsi)
 {
+       if (!wsi->u.hdr.ah)
+               return;
+
        /* init the ah to reflect no headers or data have appeared yet */
        memset(wsi->u.hdr.ah->frag_index, 0, sizeof(wsi->u.hdr.ah->frag_index));
        wsi->u.hdr.ah->nfrag = 0;