Przeglądaj źródła

Bug 630091 - (cov#15515) Use of uninitialized array in index config code

If we encounter an error early in
ldbm_instance_index_config_modify_callback(), we jump to the out
label where we free each element of the arglist array. This can
happen without initializing the array. We need to initialize arglist
before there is any chance to jump to the out label.
Nathan Kinder 15 lat temu
rodzic
commit
6f321de49e

+ 1 - 1
ldap/servers/slapd/back-ldbm/ldbm_index_config.c

@@ -396,7 +396,7 @@ ldbm_instance_index_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry *e,
     const struct berval *attrValue;
     const struct berval *attrValue;
     struct attrinfo *ainfo = NULL;
     struct attrinfo *ainfo = NULL;
     LDAPMod **mods;
     LDAPMod **mods;
-    char *arglist[4];
+    char *arglist[4] = {0};
     char *config_attr;
     char *config_attr;
     char *origIndexTypes, *origMatchingRules;
     char *origIndexTypes, *origMatchingRules;
     char **origIndexTypesArray = NULL;
     char **origIndexTypesArray = NULL;