[Privoxy-commits] [privoxy] 05/06: decompress_iob(): Cast value to unsigned char before shifting

User Git git at git.privoxy.org
Sun Feb 21 16:27:08 UTC 2021


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

git pushed a commit to branch master
in repository privoxy.

commit 9788f97d68076acffc11da82a9c65f06cd661b15
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Fri Feb 5 13:27:13 2021 +0100

    decompress_iob(): Cast value to unsigned char before shifting
    
    Prevents a left-shift of a negative value which is undefined behavior.
    
    Reported by: Joshua Rogers (Opera)
---
 parsers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parsers.c b/parsers.c
index 35e2c330..f905c92a 100644
--- a/parsers.c
+++ b/parsers.c
@@ -609,7 +609,7 @@ jb_err decompress_iob(struct client_state *csp)
              */
             int skip_bytes;
             skip_bytes = *cur++;
-            skip_bytes += *cur++ << 8;
+            skip_bytes += (unsigned char)*cur++ << 8;
 
             /*
              * The number of bytes to skip should be positive

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list