]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Small simplification in smb1 qinfo
authorVolker Lendecke <vl@samba.org>
Wed, 17 Jun 2026 21:15:33 +0000 (23:15 +0200)
committerAnoop C S <anoopcs@samba.org>
Fri, 26 Jun 2026 10:41:34 +0000 (10:41 +0000)
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 <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/smb1_trans2.c

index 5619346f90d0b55e30893dbf093b661f708c1bf9..7f1b059f94a0a4d5209462c97887374dd4a49a47 100644 (file)
@@ -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;
        }