mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Enforce PostNet and PLANET lengths
Fix suggested by Milton Neal
This commit is contained in:
parent
1057bb9fa5
commit
d7ac9cc00f
@ -91,8 +91,8 @@ int postnet(struct zint_symbol *symbol, unsigned char source[], char dest[], int
|
|||||||
|
|
||||||
error_number = 0;
|
error_number = 0;
|
||||||
|
|
||||||
if (length > 38) {
|
if (length != 5 && length != 9 && length != 11) {
|
||||||
strcpy(symbol->errtxt, "480: Input too long");
|
strcpy(symbol->errtxt, "480: Input wrong length");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
error_number = is_sane(NEON, source, length);
|
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;
|
error_number = 0;
|
||||||
|
|
||||||
if (length > 38) {
|
if (length != 11 && length != 13) {
|
||||||
strcpy(symbol->errtxt, "482: Input too long");
|
strcpy(symbol->errtxt, "482: Input wrong length");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
error_number = is_sane(NEON, source, length);
|
error_number = is_sane(NEON, source, length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user