From 44aba9c7cabedf7b5a01fb9c5f3099125dd70602 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 9 Jul 2021 18:20:30 +0200 Subject: [PATCH] nsswitch: ensure the attrlist_t array is large enough for a NULL sentinel BUG: https://bugzilla.samba.org/show_bug.cgi?id=14754 Signed-off-by: Ralph Boehme Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Mon Jul 12 15:11:42 UTC 2021 on sn-devel-184 --- nsswitch/winbind_nss_aix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsswitch/winbind_nss_aix.c b/nsswitch/winbind_nss_aix.c index 343809a4b34..f1f00e92a76 100644 --- a/nsswitch/winbind_nss_aix.c +++ b/nsswitch/winbind_nss_aix.c @@ -833,7 +833,7 @@ static attrlist_t **wb_aix_attrlist(void) logit("method attrlist called\n"); n = sizeof(attr_list) / sizeof(struct attr_types); - size = (n*sizeof(attrlist_t *)); + size = ((n + 1) * sizeof(attrlist_t *)); if ( (ret = malloc( size )) == NULL ) { errno = ENOMEM;