Browse Source

Ticket 48026 - fix invalid write for friendly attribute names

Bug Description:  When the friendly attribute names are read from the config
                  entry they are stored in an inproperly sized char pointer.

Fix Description:  The attr_friendly char pointer needs one additional byte to
                  account for the final trailing space that is appended.

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

Reviewed by: nhosoi(Thanks!)
Mark Reynolds 10 years ago
parent
commit
48a9d16a43
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ldap/servers/plugins/uiduniq/uid.c

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

@@ -395,7 +395,7 @@ uniqueness_entry_to_config(Slapi_PBlock *pb, Slapi_Entry *config_entry)
         for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) {
             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 + 1, sizeof(char));
         fp = tmp_config->attr_friendly;
         for (i = 0; tmp_config->attrs && (tmp_config->attrs)[i]; i++) {
             strcpy(fp, (tmp_config->attrs)[i] );