smbd: Fix error return for STREAM_INFO
authorVolker Lendecke <vl@samba.org>
Tue, 27 Aug 2013 09:39:17 +0000 (09:39 +0000)
committerKarolin Seeger <kseeger@samba.org>
Fri, 6 Sep 2013 08:49:50 +0000 (10:49 +0200)
The stream_info marshalling follows its own rules. This needs unifying
eventually...

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5634f240fd4273cb7327111140ccbea0fd41e3fc)

source3/smbd/trans2.c

index 2f840b73e122a97809de64eeda7ede534cc48207..3c8c06fa982a8ba591e29f2491aaa3f06589734c 100644 (file)
@@ -4145,6 +4145,10 @@ static NTSTATUS marshall_stream_info(unsigned int num_streams,
        unsigned int i;
        unsigned int ofs = 0;
 
+       if (max_data_bytes < 32) {
+               return NT_STATUS_INFO_LENGTH_MISMATCH;
+       }
+
        for (i = 0; i < num_streams; i++) {
                unsigned int next_offset;
                size_t namelen;