projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88d5b57
)
decompress_iob(): Cast value to unsigned char before shifting
author
Fabian Keil
<fk@fabiankeil.de>
Fri, 5 Feb 2021 12:27:13 +0000
(13:27 +0100)
committer
Fabian Keil
<fk@fabiankeil.de>
Sun, 21 Feb 2021 16:30:16 +0000
(17:30 +0100)
Prevents a left-shift of a negative value which is undefined behavior.
Reported by: Joshua Rogers (Opera)
parsers.c
patch
|
blob
|
history
diff --git
a/parsers.c
b/parsers.c
index
35e2c33
..
f905c92
100644
(file)
--- 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