From: Andrew Bartlett Date: Wed, 13 Nov 2019 02:51:08 +0000 (+1300) Subject: librpc: Do not return an NDR table for a zero GUID X-Git-Tag: talloc-2.3.1~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83b1c21dd0fb932b81491065067a973398bdca91;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andreas Schneider --- 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;