mirror of https://github.com/wolfSSL/wolfssh.git
Fix octal validation loop index in GetScpFileMode
The upper-bound check in the octal-to-integer conversion loop used modeOctet[0] instead of modeOctet[i], so only the first character was validated against '7'. Characters at positions 1-3 could have values above '7' without triggering an error.pull/880/head
parent
6547f04a77
commit
eab0488966
|
|
@ -854,7 +854,7 @@ static int GetScpFileMode(WOLFSSH* ssh, byte* buf, word32 bufSz,
|
|||
|
||||
for (i = 0; i < SCP_MODE_OCTET_LEN; i++)
|
||||
{
|
||||
if (modeOctet[i] < '0' || modeOctet[0] > '7') {
|
||||
if (modeOctet[i] < '0' || modeOctet[i] > '7') {
|
||||
ret = WS_BAD_ARGUMENT;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue