[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 123/178: http2: fix null pointer dereference in htt
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 123/178: http2: fix null pointer dereference in http2_connisdead |
Date: |
Wed, 23 May 2018 12:25:58 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 1d71ce845a6ac3887205c2842fad0a476f7cf3ec
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Apr 26 16:07:10 2018 +0200
http2: fix null pointer dereference in http2_connisdead
This function can get called on a connection that isn't setup enough to
have the 'recv_underlying' function pointer initialized so it would try
to call the NULL pointer.
Reported-by: Dario Weisser
Follow-up to db1b2c7fe9b093f8 (never shipped in a release)
Closes #2536
---
lib/http2.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/http2.c b/lib/http2.c
index 25d74c1a1..770ebdab5 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -202,8 +202,11 @@ static bool http2_connisdead(struct connectdata *conn)
only "protocol frames" */
CURLcode result;
struct http_conn *httpc = &conn->proto.httpc;
- ssize_t nread = ((Curl_recv *)httpc->recv_underlying)(
- conn, FIRSTSOCKET, httpc->inbuf, H2_BUFSIZE, &result);
+ ssize_t nread = -1;
+ if(httpc->recv_underlying)
+ /* if called "too early", this pointer isn't setup yet! */
+ nread = ((Curl_recv *)httpc->recv_underlying)(
+ conn, FIRSTSOCKET, httpc->inbuf, H2_BUFSIZE, &result);
if(nread != -1) {
infof(conn->data,
"%d bytes stray data read before trying h2 connection\n",
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 96/178: http2: avoid strstr() on data not zero terminated, (continued)
- [GNUnet-SVN] [gnurl] 96/178: http2: avoid strstr() on data not zero terminated, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 93/178: ftplistparser: keep state between invokes, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 112/178: examples/http2-upload: expand buffer to avoid silly warning, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 104/178: http2: convert an assert to run-time check, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 97/178: http2: clear the "drain counter" when a stream is closed, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 102/178: CURLOPT_SSLCERT.3: improve WinSSL-specific usage info, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 89/178: schannel: fix warning, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 109/178: Curl_memchr: zero length input can't match, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 101/178: schannel: fix build error on targets <= XP, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 121/178: cyassl: adapt to libraries without TLS 1.0 support built-in, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 123/178: http2: fix null pointer dereference in http2_connisdead,
gnunet <=
- [GNUnet-SVN] [gnurl] 110/178: Revert "ftplistparser: keep state between invokes", gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 126/178: CURLINFO_PROTOCOL.3: mention the existing defined names, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 113/178: ftplistparser: keep state between invokes, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 124/178: checksrc: force indentation of lines after an else, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 107/178: ftplistparser: renamed some members and variables, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 108/178: ftplistparser: keep state between invokes, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 132/178: KNOWN_BUGS: --upload-file . hang if delay in STDIN, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 134/178: KNOWN_BUGS: Client cert with Issuer DN differs between backends, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 130/178: travis: enable libssh2 on both macos and Linux, gnunet, 2018/05/23
- [GNUnet-SVN] [gnurl] 127/178: tests: provide 'manual' as a feature to optionally require, gnunet, 2018/05/23