From: Volker Lendecke Date: Wed, 17 Jun 2026 21:15:33 +0000 (+0200) Subject: smbd: Small simplification in smb1 qinfo X-Git-Tag: talloc-2.5.0~371 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2773f38917a14f4fbcf2b92dd85d034254467eff;p=thirdparty%2Fsamba.git smbd: Small simplification in smb1 qinfo handle_trans2qfilepathinfo_result() only used "fixed_portion" for an error check. Move that check to the only caller where both arguments in the comparison are different. Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 5619346f90d..7f1b059f94a 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -1981,7 +1981,6 @@ static void handle_trans2qfilepathinfo_result( NTSTATUS status, char *pdata, int data_return_size, - size_t fixed_portion, unsigned int max_data_bytes) { char params[2] = { 0, 0, }; @@ -2020,11 +2019,6 @@ static void handle_trans2qfilepathinfo_result( return; } - if (fixed_portion > max_data_bytes) { - reply_nterror(req, NT_STATUS_INFO_LENGTH_MISMATCH); - return; - } - send_trans2_replies( conn, req, @@ -2135,6 +2129,11 @@ static void call_trans2qfilepathinfo(connection_struct *conn, &fixed_portion, ppdata, &data_size); + if (fixed_portion > max_data_bytes) { + reply_nterror(req, NT_STATUS_INFO_LENGTH_MISMATCH); + return; + } + handle_trans2qfilepathinfo_result( conn, req, @@ -2142,7 +2141,6 @@ static void call_trans2qfilepathinfo(connection_struct *conn, status, *ppdata, data_size, - fixed_portion, max_data_bytes); } @@ -2779,7 +2777,6 @@ static void call_trans2qpathinfo( status, *ppdata, total_data, - total_data, max_data_bytes); return; } @@ -3025,7 +3022,6 @@ static void call_trans2qfileinfo( status, *ppdata, total_data, - total_data, max_data_bytes); return; }