mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-24 20:14:28 -04:00
CLI: validate_int: just fail if length > 9
This commit is contained in:
parent
6274140c73
commit
5d4fe0b572
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue