summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2019-11-13 15:51:08 +1300
committerAndreas Schneider <asn@cryptomilk.org>2019-11-14 08:01:43 +0000
commit83b1c21dd0fb932b81491065067a973398bdca91 (patch)
treeb2f1370f42d365e688a809d90f1d2597a551e573
parente45feaf28da27653e9df36c7c50cbd54a792a2aa (diff)
downloadsamba-83b1c21dd0fb932b81491065067a973398bdca91.tar.gz
librpc: Do not return an NDR table for a zero GUID
The source3 RPC server will do a lookup by GUID and should not be returned a table for a zero GUID. Thankfully such a pipe would also need to have been registered but regardless this is not a determinsitic result so should be avoided. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--librpc/ndr/ndr_table.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/librpc/ndr/ndr_table.c b/librpc/ndr/ndr_table.c
index c386b8c0030..bc44fd38e33 100644
--- a/librpc/ndr/ndr_table.c
+++ b/librpc/ndr/ndr_table.c
@@ -129,6 +129,10 @@ const struct ndr_interface_table *ndr_table_by_name(const char *name)
const struct ndr_interface_table *ndr_table_by_syntax(const struct ndr_syntax_id *syntax)
{
const struct ndr_interface_list *l;
+ if (GUID_all_zero(&syntax->uuid)) {
+ /* These are not unique */
+ return NULL;
+ }
for (l=ndr_table_list();l;l=l->next) {
if (ndr_syntax_id_equal(&l->table->syntax_id, syntax)) {
return l->table;
@@ -143,6 +147,10 @@ const struct ndr_interface_table *ndr_table_by_syntax(const struct ndr_syntax_id
const struct ndr_interface_table *ndr_table_by_uuid(const struct GUID *uuid)
{
const struct ndr_interface_list *l;
+ if (GUID_all_zero(uuid)) {
+ /* These are not unique */
+ return NULL;
+ }
for (l=ndr_table_list();l;l=l->next) {
if (GUID_equal(&l->table->syntax_id.uuid, uuid)) {
return l->table;