mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08: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…
Reference in New Issue
Block a user