浏览代码

Ticket 48986 - 47808 triggers overflow in uiduniq.c

Bug Description:  Certain configurations of uiduniq.c would cause an overflow
when running with Address Sanitiser

Fix Description:  Increase the size of the allocation to tmp_config->attrs.

https://fedorahosted.org/389/ticket/48986

Author: nhosoi

Reviewed by: wibrown
William Brown 9 年之前
父节点
当前提交
ffda694dd6
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      ldap/servers/plugins/uiduniq/uid.c

+ 2 - 2
ldap/servers/plugins/uiduniq/uid.c

@@ -302,7 +302,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry)
                         }
                         
                         /* Store attrName in the config */
-                        tmp_config->attrs = (const char **) slapi_ch_calloc(1, sizeof(char *));
+                        tmp_config->attrs = (const char **) slapi_ch_calloc(2, sizeof(char *));
                         tmp_config->attrs[0] = slapi_ch_strdup(attrName);
                         argc--;
                         argv++; /* First argument was attribute name and remaining are subtrees */
@@ -345,7 +345,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry)
                          *  - requiredObjectClass 
                          */
                         /* Store attrName in the config */
-                        tmp_config->attrs = (const char **) slapi_ch_calloc(1, sizeof(char *));
+                        tmp_config->attrs = (const char **) slapi_ch_calloc(2, sizeof(char *));
                         tmp_config->attrs[0] = slapi_ch_strdup(attrName);
                         
                         /* There is no subtrees */