File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 2020#define HDR_TRAILING_ZEROS_INVALID -29992
2121#define HDR_VALUE_TRUNCATED -29991
2222#define HDR_ENCODED_INPUT_TOO_LONG -29990
23+ #define HDR_INVALID_WORD_SIZE -29989
2324
2425#define HDR_LOG_TAG_MAX_BUFFER_LEN (1024)
2526
Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ const char* hdr_strerror(int errnum)
101101 return "Truncated value found when decoding" ;
102102 case HDR_ENCODED_INPUT_TOO_LONG :
103103 return "The encoded input exceeds the size of the histogram" ;
104+ case HDR_INVALID_WORD_SIZE :
105+ return "Invalid word size" ;
104106 default :
105107 return strerror (errnum );
106108 }
@@ -499,6 +501,10 @@ static int hdr_decode_compressed_v1(
499501 }
500502
501503 word_size = word_size_from_cookie (be32toh (encoding_flyweight .cookie ));
504+ if (word_size == 0 )
505+ {
506+ FAIL_AND_CLEANUP (cleanup , result , HDR_INVALID_WORD_SIZE );
507+ }
502508 counts_limit = be32toh (encoding_flyweight .payload_len ) / word_size ;
503509 lowest_discernible_value = be64toh (encoding_flyweight .lowest_discernible_value );
504510 highest_trackable_value = be64toh (encoding_flyweight .highest_trackable_value );
You can’t perform that action at this time.
0 commit comments