Skip to content

Commit

Permalink
ksmbd: fix infinite loop in smb2_query_dir
Browse files Browse the repository at this point in the history
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
namjaejeon committed Dec 4, 2024
1 parent 9bb3615 commit c2704db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4645,7 +4645,7 @@ int smb2_query_dir(struct ksmbd_work *work)
* the end of the directory and no file is matched with the search
* pattern.
*/
if (rc >= 0 && !d_info.num_entry && d_info.num_scan)
if (rc >= 0 && !d_info.num_entry && d_info.num_scan && d_info.out_buf_len > 0)
goto again;
/*
* req->OutputBufferLength is too small to contain even one entry.
Expand Down

0 comments on commit c2704db

Please sign in to comment.