From 892f03a7d8f7c8fb8ca2a481cbf919ff384d0161 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 9 Feb 2016 09:15:02 +0800 Subject: [PATCH] lws_reset_header_table dont reset NULL This is only a temporary, fragile solution. https://github.com/warmcat/libwebsockets/issues/416 Signed-off-by: Andy Green --- lib/parsers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/parsers.c b/lib/parsers.c index 8de76868..d556b9fb 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -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;