EANX_CC/UPCA_CC: fix crash in dbar_date() on not checking length

in `cc_binary_string()`, ticket #300 (#5 & #6), props Andre Maute;
  add other checks for length on processing encoding mode
PDF417: fix out-of-bounds crash on overrunning string and codeword
  buffers by tripling size (convert to `short` instead of `int` to
  guard against too much stack), ticket #300 (#7 & #10), props Andre
  Maute; (TODO: add some checks instead to bail out earlier?)
CODEONE: fix looping on latch crash in `c1_encode()`, ticket #300 (#8),
  props Andre Maute
CODABLOCKF: fix crash on negative overflow of `columns` (`option_2`),
  ticket #300 (#9), props Andre Maute
library: add `debug_print_escape()` helper for ZINT_DEBUG_PRINT
This commit is contained in:
gitlost 2023-11-27 12:55:53 +00:00
parent 77c1ef1139
commit a14fe77aa0
17 changed files with 561 additions and 193 deletions

View file

@ -586,6 +586,9 @@ INTERNAL int codablockf(struct zint_symbol *symbol, unsigned char source[], int
strcpy(symbol->errtxt, "411: Columns parameter not in 0, 9..67");
return ZINT_ERROR_INVALID_OPTION;
}
if (columns < 0) { /* Protect against negative overflow (ticket #300 (#9) Andre Maute) */
columns = 0;
}
data = (unsigned char *) z_alloca(length * 2 + 1);