1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-18 10:27:09 +00:00

composite: fix buffer overflow for large linear, small composite (500 -> 1000)

composite: clear errtxt when bumping from CC-A -> CC-B -> CC-C
composite: CC-C adjustment 53 -> 52 (same as BWIPP) with proper explanation
composite: remove unneeded > 11805 length check
CODEONE: remove unneeded extended ASCII check in C40 count
GS1_128/CODE16K: remove unneeded initial GS1 mode '[' check
PDF417: remove unneeded second option_2 > 30 check
Document some "Not reached" lines (code coverage)
Update bwipp_dump.ps
GUI: window/tab height +5 so 2 full lines for composite edit box (Ubuntu)
manual: dash -> hyphen, PDF417 "check digit" -> "error correction", DMRE ref
tests: further test cases for CODEONE/CODE16K/common/composite/DATAMATRIX/
DOTCODE/gs1/MAXICODE/PDF417/postal/QRCODE
This commit is contained in:
gitlost
2021-08-05 16:34:45 +01:00
parent f0bfb8d920
commit b015e38da0
28 changed files with 3610 additions and 2019 deletions

View File

@@ -451,10 +451,6 @@ static int c40text_cnt(const int current_mode, const int gs1, unsigned char inpu
return 2;
}
cnt = 1;
if (input & 0x80) {
cnt += 2;
input = input - 128;
}
if ((current_mode == C1_C40 && c40_shift[input]) || (current_mode == C1_TEXT && text_shift[input])) {
cnt += 1;
}
@@ -814,7 +810,7 @@ static int c1_encode(struct zint_symbol *symbol, unsigned char source[], unsigne
if (cte_p >= 1) {
int cws_remaining = codewords_remaining(symbol, tp);
/* Note doing strict interpretation of spec here (same as BWIPP), unlike in Data Matrix case */
/* Note doing strict interpretation of spec here (same as BWIPP), as now also done in Data Matrix case */
if (cws_remaining == 1 && cte_p == 1 && isc40text(current_mode, source[sp - 1])) {
/* 2.2.2.2 "...except when a single symbol character is left at the end before the first
error correction character. This single character is encoded in the ASCII code set." */