From: Douglas Bagnall Date: Fri, 10 Jan 2020 02:45:45 +0000 (+1300) Subject: libgpo: parse_gp_ext: do not crash upon no ext_strings X-Git-Tag: ldb-2.1.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c01a44f18b679709d141b2d05e576ee084039b4;p=thirdparty%2Fsamba.git libgpo: parse_gp_ext: do not crash upon no ext_strings Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- diff --git a/libgpo/gpo_ldap.c b/libgpo/gpo_ldap.c index e5a5adb7235..2d95f74276c 100644 --- a/libgpo/gpo_ldap.c +++ b/libgpo/gpo_ldap.c @@ -98,7 +98,9 @@ bool ads_parse_gp_ext(TALLOC_CTX *mem_ctx, for (k = 0; ext_strings[k] != NULL; k++) { /* no op */ } - + if (k == 0) { + goto parse_error; + } q = ext_strings[0]; if (q[0] == '{') {