From: Kurt Zeilenga Date: Mon, 5 Aug 2002 19:44:24 +0000 (+0000) Subject: Prevent overflow in .rej creation (ITS#2007) X-Git-Tag: NO_SLAP_OP_BLOCKS~1286 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=64791571aa7e8a5006905c42845c26d94f9a0a26;p=openldap Prevent overflow in .rej creation (ITS#2007) --- diff --git a/servers/slurpd/reject.c b/servers/slurpd/reject.c index 2596ab57bc..130b828d1e 100644 --- a/servers/slurpd/reject.c +++ b/servers/slurpd/reject.c @@ -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 */