-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/lib/http2.c b/lib/http2.c | ||
index c8b059498..04dee198c 100644 | ||
--- a/lib/http2.c | ||
+++ b/lib/http2.c | ||
@@ -2062,10 +2062,18 @@ static ssize_t h2_submit(struct stream_ctx **pstream, | ||
|
||
for(i = 0; i < nheader; ++i) { | ||
struct dynhds_entry *e = Curl_dynhds_getn(&h2_headers, i); | ||
- nva[i].name = (unsigned char *)e->name; | ||
- nva[i].namelen = e->namelen; | ||
- nva[i].value = (unsigned char *)e->value; | ||
- nva[i].valuelen = e->valuelen; | ||
+ if(e) { | ||
+ nva[i].name = (unsigned char *)e->name; | ||
+ nva[i].namelen = e->namelen; | ||
+ nva[i].value = (unsigned char *)e->value; | ||
+ nva[i].valuelen = e->valuelen; | ||
+ } | ||
+ else { | ||
+ nva[i].name = NULL; | ||
+ nva[i].namelen = 0; | ||
+ nva[i].value = NULL; | ||
+ nva[i].valuelen = 0; | ||
+ } | ||
nva[i].flags = NGHTTP2_NV_FLAG_NONE; | ||
} | ||
|