mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 09:21:50 -05:00
smb: check for full size message before reading message details
To avoid reading of uninitialized data. Assisted-by: Max Dymond Bug: https://crbug.com/oss-fuzz/16907 Closes #4363
This commit is contained in:
parent
00da834156
commit
6de1053692
@ -682,7 +682,8 @@ static CURLcode smb_connection_state(struct connectdata *conn, bool *done)
|
||||
|
||||
switch(smbc->state) {
|
||||
case SMB_NEGOTIATE:
|
||||
if(h->status || smbc->got < sizeof(*nrsp) + sizeof(smbc->challenge) - 1) {
|
||||
if((smbc->got < sizeof(*nrsp) + sizeof(smbc->challenge) - 1) ||
|
||||
h->status) {
|
||||
connclose(conn, "SMB: negotiation failed");
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user