Pārlūkot izejas kodu

Ticket #48026 - Support for uniqueness plugin to enforce uniqueness on a set of attributes.

Coverity defect 13088 - Wrong sized argument
Introduced by commit 430410d75446cdf58e6f020e1463b590abd870ab
Description: allocated the size of pointer instead of the size of
character times attribute length.  The unit was fixed.

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

Reviewed and tested by William B <[email protected]>.
Thank you, William!!
Noriko Hosoi 10 gadi atpakaļ
vecāks
revīzija
1aeaf342ff
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      ldap/servers/plugins/uiduniq/uid.c

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

@@ -367,7 +367,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry)
         for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) {
         for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) {
             attrLen += strlen((tmp_config->attrs)[i]) + 1;
             attrLen += strlen((tmp_config->attrs)[i]) + 1;
         }
         }
-        tmp_config->attr_friendly = (char *) slapi_ch_calloc(attrLen, sizeof(char *));
+        tmp_config->attr_friendly = (char *) slapi_ch_calloc(attrLen, sizeof(char));
         fp = tmp_config->attr_friendly;
         fp = tmp_config->attr_friendly;
         for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) {
         for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) {
             strcpy(fp, (tmp_config->attrs)[i] );
             strcpy(fp, (tmp_config->attrs)[i] );