s4-libcli: GUID_from_ndr_blob() is strict about the blob size
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 Dec 2009 03:48:56 +0000 (14:48 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Dec 2009 06:51:30 +0000 (17:51 +1100)
We need to create a blob of the right length

source4/libcli/raw/rawfsinfo.c

index 4c79ba066c6318fac9f5404b07fd17a805a28ad6..15599adebe510ce251cca0381a5a77a7f07d9b58 100644 (file)
@@ -214,14 +214,16 @@ NTSTATUS smb_raw_fsinfo_passthru_parse(DATA_BLOB blob, TALLOC_CTX *mem_ctx,
                fsinfo->full_size_information.out.bytes_per_sector =         IVAL(blob.data, 28);
                break;          
 
-       case RAW_QFS_OBJECTID_INFORMATION:
+       case RAW_QFS_OBJECTID_INFORMATION: {
+               DATA_BLOB b2 = data_blob_const(blob.data, MIN(16, blob.length));
                QFS_CHECK_SIZE(64);
-               status = GUID_from_ndr_blob(&blob, &fsinfo->objectid_information.out.guid);
+               status = GUID_from_ndr_blob(&b2, &fsinfo->objectid_information.out.guid);
                NT_STATUS_NOT_OK_RETURN(status);
                for (i=0;i<6;i++) {
                        fsinfo->objectid_information.out.unknown[i] = BVAL(blob.data, 16 + i*8);
                }
                break;
+       }
                
        default:
                status = NT_STATUS_INVALID_INFO_CLASS;