1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-24 05:17:05 +00:00

AZTEC: change max byte count from assert() to if as overlong data

can trigger it (fuzz_data (1st))
This commit is contained in:
gitlost
2024-01-04 22:43:41 +00:00
parent 3cb724253b
commit d42eb13841
5 changed files with 255 additions and 25 deletions

View File

@@ -576,7 +576,9 @@ static int aztec_text_process(const unsigned char source[], int src_len, int bp,
int big_batch = 0;
for (count = 0; ((i + count) < reduced_length) && (reduced_encode_mode[i + count] == 'B'); count++);
assert(count <= 2047 + 2078); /* Can't be more than 19968 / 8 = 2496 */
if (count > 2047 + 2078) { /* Can't be more than 19968 / 8 = 2496 */
return 0;
}
if (count > 2047) { /* Max 11-bit number */
big_batch = count > 2078 ? 2078 : count;