mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cov: validate i before underflow
Although it can't happen in this code, ensure 'i' is not 0 before decrementing it.
This commit is contained in:
parent
fef49a0e86
commit
960df88621
@ -999,7 +999,8 @@ char yes_no_prompt(const char *prompt, ...)
|
||||
answer = _no + 1; /* Expecting 'No' */
|
||||
} else if (!ret && isspace(c)) {
|
||||
/* Ignore any whitespace before */
|
||||
--i;
|
||||
if (i > 0)
|
||||
i--;
|
||||
goto nextchar;
|
||||
} else if ((ret > 0) && answer && isspace(c)) {
|
||||
/* Ignore any whitespace after */
|
||||
|
Loading…
Reference in New Issue
Block a user