s3-librpc: Fixed GUID_from_data_blob() with length of 32.
authorAndreas Schneider <asn@samba.org>
Mon, 28 Jun 2010 19:00:30 +0000 (21:00 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Jul 2010 10:18:47 +0000 (12:18 +0200)
If we hit the case that the blob length is 32. The code goes to the end
of the function and generates a GUID with garbage.
So try to convert the blob to the GUID and return.

Fix bug #7538 (Backport fixes for GUID_from_data_blob).

librpc/ndr/uuid.c

index 2b472468061f6f7db76925089a21da48330322d3..80c35cde861306180a25a394c2a43542630e9236 100644 (file)
@@ -81,11 +81,12 @@ _PUBLIC_ NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid)
        } else if (s->length == 32) {
                size_t rlen = strhex_to_str((char *)blob16.data, blob16.length,
                                            (const char *)s->data, s->length);
-               if (rlen == blob16.length) {
-                       /* goto the ndr_pull_struct_blob() path */
-                       status = NT_STATUS_OK;
-                       s = &blob16;
+               if (rlen != blob16.length) {
+                       return NT_STATUS_INVALID_PARAMETER;
                }
+
+               s = &blob16;
+               return GUID_from_ndr_blob(s, guid);
        }
 
        if (s->length == 16) {