wolfsshd: Stop option parsing when a Windows argv conversion fails

pull/1225/head
Emma Stensland 2026-09-02 11:21:21 -06:00 committed by John Safranek
parent 6a71292401
commit 5a1ff71acd
1 changed files with 8 additions and 0 deletions

View File

@ -3109,8 +3109,16 @@ static int StartSSHD(int argc, char** argv)
}
else {
unsigned int z;
/* Zero first: _freeWinArgs() walks all argc slots. */
WMEMSET(argv, 0, argc * sizeof(char*));
for (z = 0; z < argc; z++) {
argv[z] = _convertHelper(cmdArgs[z], NULL);
if (argv[z] == NULL) {
/* mygetopt() dereferences every entry it walks. */
ret = WS_MEMORY_E;
break;
}
}
}
}