Merge pull request #304 from guidovranken/oss-fuzz-27298

Use WSTRNCMP for comparing session command string
pull/312/head
JacobBarthelmeh 2021-01-27 03:30:51 +07:00 committed by GitHub
commit e097c234fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -540,7 +540,7 @@ int wolfSSH_accept(WOLFSSH* ssh)
const char* cmd = wolfSSH_GetSessionCommand(ssh);
if (cmd != NULL &&
WOLFSSH_SESSION_SUBSYSTEM == wolfSSH_GetSessionType(ssh)
&& (WMEMCMP(cmd, "sftp", sizeof("sftp")) == 0)) {
&& (WSTRNCMP(cmd, "sftp", 4) == 0)) {
ssh->acceptState = ACCEPT_INIT_SFTP;
return wolfSSH_SFTP_accept(ssh);
}