mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Avoid SIGSEGV on Code 128 input too long
This commit is contained in:
parent
24f175b6f6
commit
e81a90bb58
@ -1060,6 +1060,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source,int
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error_number == 0) {
|
||||||
if ((symbol->symbology == BARCODE_CODE128) || (symbol->symbology == BARCODE_CODE128B)) {
|
if ((symbol->symbology == BARCODE_CODE128) || (symbol->symbology == BARCODE_CODE128B)) {
|
||||||
for (i = 0; i < in_length; i++) {
|
for (i = 0; i < in_length; i++) {
|
||||||
if (local_source[i] == '\0') {
|
if (local_source[i] == '\0') {
|
||||||
@ -1069,9 +1070,6 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source,int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error_number == 0) {
|
|
||||||
|
|
||||||
error_number = error_buffer;
|
error_number = error_buffer;
|
||||||
}
|
}
|
||||||
error_tag(symbol->errtxt, error_number);
|
error_tag(symbol->errtxt, error_number);
|
||||||
|
Loading…
Reference in New Issue
Block a user