Skip to content

Commit 1a0be64

Browse files
authored
Merge pull request #90 from JacobBarthelmeh/fuzz
fix for possible overflow with sanity check
2 parents 7e62b48 + 962ee5a commit 1a0be64

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ static int DoKexDhReply(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
22042204
begin = *idx;
22052205
pubKey = buf + begin;
22062206
ret = GetUint32(&pubKeySz, buf, len, &begin);
2207-
if (ret == WS_SUCCESS && (pubKeySz + LENGTH_SZ + begin > len)) {
2207+
if (ret == WS_SUCCESS && (pubKeySz > len - LENGTH_SZ - begin )) {
22082208
ret = WS_BUFFER_E;
22092209
}
22102210

0 commit comments

Comments
 (0)