]> git.sur5r.net Git - openldap/commitdiff
Prevent overflow in .rej creation (ITS#2007)
authorKurt Zeilenga <kurt@openldap.org>
Mon, 5 Aug 2002 19:44:24 +0000 (19:44 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 5 Aug 2002 19:44:24 +0000 (19:44 +0000)
servers/slurpd/reject.c

index 2596ab57bc6b49f2b4e410f3c891f60957f28449..130b828d1ee3caaa15dacb1114f5aa02d1e0944c 100644 (file)
@@ -57,8 +57,8 @@ write_reject(
     int                rc;
 
     ldap_pvt_thread_mutex_lock( &sglob->rej_mutex );
-    sprintf( rejfile, "%s" LDAP_DIRSEP "%s:%d.rej", sglob->slurpd_rdir,
-           ri->ri_hostname, ri->ri_port );
+    snprintf( rejfile, sizeof rejfile, "%s" LDAP_DIRSEP "%s:%d.rej",
+               sglob->slurpd_rdir, ri->ri_hostname, ri->ri_port );
 
     if ( access( rejfile, F_OK ) < 0 ) {
        /* Doesn't exist - try to create */