Browse Source

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 năm trước cách đây
mục cha
commit
6f321de49e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      ldap/servers/slapd/back-ldbm/ldbm_index_config.c

+ 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;
     struct attrinfo *ainfo = NULL;
     LDAPMod **mods;
-    char *arglist[4];
+    char *arglist[4] = {0};
     char *config_attr;
     char *origIndexTypes, *origMatchingRules;
     char **origIndexTypesArray = NULL;