gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 84/222: http2: A value is being subtracted from the unsigned var


From: gnunet
Subject: [gnurl] 84/222: http2: A value is being subtracted from the unsigned variable
Date: Thu, 07 Nov 2019 00:09:40 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit f91b82e688e7a9f2b843a121748d4b5b4f1180b6
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Sep 23 11:04:13 2019 +0200

    http2: A value is being subtracted from the unsigned variable
    
    PVS-Studio warning
    Fixes #4402
---
 lib/http2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/http2.c b/lib/http2.c
index b33782cc3..1481d1425 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1775,8 +1775,9 @@ static ssize_t http2_recv(struct connectdata *conn, int 
sockindex,
    field list. */
 #define AUTHORITY_DST_IDX 3
 
+/* USHRT_MAX is 65535 == 0xffff */
 #define HEADER_OVERFLOW(x) \
-  (x.namelen > (uint16_t)-1 || x.valuelen > (uint16_t)-1 - x.namelen)
+  (x.namelen > 0xffff || x.valuelen > 0xffff - x.namelen)
 
 /*
  * Check header memory for the token "trailers".

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]