sanity check on auth name size

pull/231/head
Jacob Barthelmeh 2019-12-17 14:23:58 -07:00
parent c01edacd09
commit 6c86ccabc1
1 changed files with 6 additions and 0 deletions

View File

@ -3763,6 +3763,12 @@ static int DoUserAuthRequest(WOLFSSH* ssh,
ret = GetUint32(&authData.authNameSz, buf, len, &begin);
}
if (ret == WS_SUCCESS) {
if (authData.authNameSz > len - begin) {
ret = WS_BUFFER_E;
}
}
if (ret == WS_SUCCESS) {
authData.authName = buf + begin;
begin += authData.authNameSz;