瀏覽代碼

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 年之前
父節點
當前提交
6f321de49e
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;