From fc17c0a618ec581e16fe6b964b856778c350d071 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 7 May 2015 19:37:43 +0900 Subject: [PATCH] Fix global-buffer-overflow --- lib/nghttp2_hd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 31b563dd..2c08fee1 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1157,15 +1157,11 @@ static nghttp2_hd_entry *add_hd_table_incremental(nghttp2_hd_context *context, } static int name_eq(const nghttp2_nv *a, const nghttp2_nv *b) { - return a->namelen == b->namelen && - a->name[a->namelen - 1] == b->name[a->namelen - 1] && - memeq(a->name, b->name, a->namelen); + return a->namelen == b->namelen && memeq(a->name, b->name, a->namelen); } static int value_eq(const nghttp2_nv *a, const nghttp2_nv *b) { - return a->valuelen == b->valuelen && - a->value[a->valuelen - 1] == b->value[a->valuelen - 1] && - memeq(a->value, b->value, a->valuelen); + return a->valuelen == b->valuelen && memeq(a->value, b->value, a->valuelen); } typedef struct {