From: Andy Green Date: Wed, 4 Jan 2017 06:38:39 +0000 (+0800) Subject: client: protect against possible NULL deref path X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_3.0;p=platform%2Fupstream%2Flibwebsockets.git client: protect against possible NULL deref path Change-Id: I1a2e3f05bc3b79e65bd32e9ba3fa0603a22f47c7 --- diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 5ab49a12..dc4aa5f4 100755 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -408,7 +408,9 @@ just_kill_connection: char* errorString; lwsl_debug("Connection closed before server reply\n"); - errorString = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP); + errorString = NULL; + if (wsi->u.hdr.ah) + errorString = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP); if (errorString) { context->protocols[0].callback(wsi, LWS_CALLBACK_CLIENT_CONNECTION_ERROR,