From: Kurt Zeilenga Date: Mon, 11 Sep 2000 19:05:24 +0000 (+0000) Subject: ITS#722: disallow argument buffer overflow X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2056 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6a3b8e281b0133809726ea54cd5677a44a4d8d39;p=openldap ITS#722: disallow argument buffer overflow --- diff --git a/servers/slurpd/args.c b/servers/slurpd/args.c index f9cd9db8a3..8f8458c34d 100644 --- a/servers/slurpd/args.c +++ b/servers/slurpd/args.c @@ -106,7 +106,9 @@ doargs( g->slapd_configfile = strdup( optarg ); break; case 'r': /* slapd replog file */ - strcpy( g->slapd_replogfile, optarg ); + strncpy( g->slapd_replogfile, optarg, + sizeof(g->slapd_replogfile)-1 ); + g->slapd_replogfile[sizeof(g->slapd_replogfile)-1] = '\0'; rflag++; break; case 't': /* dir to use for our copies of replogs */ @@ -150,7 +152,4 @@ doargs( #endif return 0; - } - -