##// END OF EJS Templates
bitmanipulation: fix undefined behavior in bit shift in getbe32...
Augie Fackler -
r38322:1fb2510c @40 default
parent child Browse files
Show More
@@ -78,6 +78,10 b' with zipfile.ZipFile(args.out[0], "w", z'
78 78 zf.writestr(
79 79 "mpatch_decode_old_overread", "\x02\x00\x00\x00\x02\x00\x00\x00"
80 80 )
81 # https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8876
82 zf.writestr(
83 "mpatch_ossfuzz_getbe32_ubsan",
84 "\x02\x00\x00\x00\x0c \xff\xff\xff\xff ")
81 85 zf.writestr(
82 86 "mpatch_apply_over_memcpy",
83 87 '\x13\x01\x00\x05\xd0\x00\x00\x00\x00\x00\x00\x00\x00\n \x00\x00\x00'
@@ -9,7 +9,8 b' static inline uint32_t getbe32(const cha'
9 9 {
10 10 const unsigned char *d = (const unsigned char *)c;
11 11
12 return ((d[0] << 24) | (d[1] << 16) | (d[2] << 8) | (d[3]));
12 return ((((uint32_t)d[0]) << 24) | (((uint32_t)d[1]) << 16) |
13 (((uint32_t)d[2]) << 8) | (d[3]));
13 14 }
14 15
15 16 static inline int16_t getbeint16(const char *c)
General Comments 0
You need to be logged in to leave comments. Login now