[389-commits] ldap/servers

Mark Reynolds mreynolds at fedoraproject.org
Tue May 12 15:44:32 UTC 2015


 ldap/servers/plugins/uiduniq/uid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 48a9d16a43d38af1292a1f306d23243702286608
Author: Mark Reynolds <mreynolds at redhat.com>
Date:   Tue May 12 10:43:26 2015 -0400

    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!)

diff --git a/ldap/servers/plugins/uiduniq/uid.c b/ldap/servers/plugins/uiduniq/uid.c
index 5b57828..85f3d9e 100644
--- a/ldap/servers/plugins/uiduniq/uid.c
+++ b/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] );




More information about the 389-commits mailing list