summaryrefslogtreecommitdiff
path: root/upb/decode.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2017-07-19 00:48:15 +0200
committerJoshua Haberman <jhaberman@gmail.com>2017-07-19 00:48:15 +0200
commit98f513fb8fa5e3360baeb59c37636ca71d562490 (patch)
treed22087878f81edeecf988b8aa22ea6eea9ed1461 /upb/decode.c
parent6b8767422154008eed98d0df42e36758d38877a4 (diff)
Fixed 32-bit build and added generated files.
Diffstat (limited to 'upb/decode.c')
-rw-r--r--upb/decode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/upb/decode.c b/upb/decode.c
index cba9f61..8c3ecb4 100644
--- a/upb/decode.c
+++ b/upb/decode.c
@@ -116,7 +116,9 @@ static bool upb_decode_string(const char **ptr, const char *limit,
upb_stringview *val) {
uint32_t len;
- CHK(upb_decode_varint32(ptr, limit, &len) && limit - *ptr >= len);
+ CHK(upb_decode_varint32(ptr, limit, &len) &&
+ len < INT32_MAX &&
+ limit - *ptr >= (int32_t)len);
*val = upb_stringview_make(*ptr, len);
*ptr += len;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback