mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
CLI: validate_int: just fail if length > 9
This commit is contained in:
parent
6274140c73
commit
5d4fe0b572
@ -207,7 +207,7 @@ static int validate_int(const char source[], int *p_val) {
|
|||||||
int length = (int) strlen(source);
|
int length = (int) strlen(source);
|
||||||
|
|
||||||
if (length > 9) { /* Prevent overflow */
|
if (length > 9) { /* Prevent overflow */
|
||||||
length = 9;
|
return 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
if (source[i] < '0' || source[i] > '9') {
|
if (source[i] < '0' || source[i] > '9') {
|
||||||
|
Loading…
Reference in New Issue
Block a user