]> git.sur5r.net Git - openldap/commitdiff
remove potential buffer overflow, now that rids can be up to 4096
authorPierangelo Masarati <ando@openldap.org>
Sat, 29 Sep 2007 16:11:28 +0000 (16:11 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 29 Sep 2007 16:11:28 +0000 (16:11 +0000)
servers/slapd/syncrepl.c

index a657088bed3fec522844fc5fc38ecde27c922a88..11e38ac36f47e807ffe93a4cc504c0e6b866dd3d 100644 (file)
@@ -3002,7 +3002,7 @@ nonpresent_callback(
 
        } else if ( rs->sr_type == REP_SEARCH ) {
                if ( !( si->si_refreshDelete & NP_DELETE_ONE ) ) {
-                       char buf[sizeof("rid=000 not")];
+                       char buf[sizeof("rid=4096 not")];
 
                        a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_entryUUID );
 
@@ -3012,7 +3012,7 @@ nonpresent_callback(
                        }
 
                        if ( slap_debug & LDAP_DEBUG_SYNC ) {
-                               sprintf( buf, "%s %s", si->si_ridtxt,
+                               snprintf( buf, sizeof(buf), "%s %s", si->si_ridtxt,
                                        present_uuid ? "got" : "not" );
                        }