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)
committerAndreas Schneider <asn@samba.org>
Tue, 29 Jun 2010 09:12:12 +0000 (11:12 +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.

librpc/ndr/uuid.c

index d46da0993d7f08fd1b9be93957d4b1fce705d1ea..33a7eeeb5a77cae1b69aaa2c1f7fcd1d92fd1902 100644 (file)
@@ -117,12 +117,12 @@ _PUBLIC_ NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid)
        {
                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;
                }
-               break;
+
+               s = &blob16;
+               return GUID_from_ndr_blob(s, guid);
        }
        case 16:
                return GUID_from_ndr_blob(s, guid);