mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-13 06:34:32 -04:00
Enforce PostNet and PLANET lengths
Fix suggested by Milton Neal
This commit is contained in:
parent
1057bb9fa5
commit
d7ac9cc00f
1 changed files with 4 additions and 4 deletions
|
@ -91,8 +91,8 @@ int postnet(struct zint_symbol *symbol, unsigned char source[], char dest[], int
|
|||
|
||||
error_number = 0;
|
||||
|
||||
if (length > 38) {
|
||||
strcpy(symbol->errtxt, "480: Input too long");
|
||||
if (length != 5 && length != 9 && length != 11) {
|
||||
strcpy(symbol->errtxt, "480: Input wrong length");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
error_number = is_sane(NEON, source, length);
|
||||
|
@ -157,8 +157,8 @@ int planet(struct zint_symbol *symbol, unsigned char source[], char dest[], int
|
|||
|
||||
error_number = 0;
|
||||
|
||||
if (length > 38) {
|
||||
strcpy(symbol->errtxt, "482: Input too long");
|
||||
if (length != 11 && length != 13) {
|
||||
strcpy(symbol->errtxt, "482: Input wrong length");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
error_number = is_sane(NEON, source, length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue