mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-27 21:44:13 -04:00
CODEONE: fix out-of-bounds crash in c1_c40text_cnt()
not
accounting for extended ASCII shifts, ticket #300 (no. 4), props Andre Maute
This commit is contained in:
parent
dfc4049932
commit
77c1ef1139
4 changed files with 34 additions and 2 deletions
|
@ -447,6 +447,10 @@ static int c1_c40text_cnt(const int current_mode, const int gs1, unsigned char i
|
|||
return 2;
|
||||
}
|
||||
cnt = 1;
|
||||
if (input & 0x80) {
|
||||
cnt += 2;
|
||||
input -= 128;
|
||||
}
|
||||
if ((current_mode == C1_C40 && c40_shift[input]) || (current_mode == C1_TEXT && text_shift[input])) {
|
||||
cnt += 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue