diff options
author | Andreas Schneider <asn@samba.org> | 2010-06-28 21:00:30 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-01-13 17:58:50 +0100 |
commit | a5fff7220d29446fa0fd020a2798349ad04a6b8b (patch) | |
tree | ee34b0f9ea210377bc80b0142088fbc6e8212697 | |
parent | f2804944ad626775cbe5f4c97011b50b0dd31004 (diff) | |
download | samba-a5fff7220d29446fa0fd020a2798349ad04a6b8b.tar.gz |
s3-librpc: Fixed GUID_from_data_blob() with length of 32.
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).
(cherry picked from commit 3c4353d2aa15db278bb87c949cce2deb3a5072ca)
(cherry picked from commit 10e34cff5588b0d6434a093b3ecf90e6ccc1796a)
-rw-r--r-- | librpc/ndr/uuid.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c index 2b472468061..80c35cde861 100644 --- a/librpc/ndr/uuid.c +++ b/librpc/ndr/uuid.c @@ -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) { |