]> git.sur5r.net Git - openldap/commitdiff
ITS#722: disallow argument buffer overflow
authorKurt Zeilenga <kurt@openldap.org>
Mon, 11 Sep 2000 19:05:24 +0000 (19:05 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 11 Sep 2000 19:05:24 +0000 (19:05 +0000)
servers/slurpd/args.c

index f9cd9db8a3056db2886362f8ee74bbb7f1eeb027..8f8458c34db09b9a4ee43ef205863c7d72c84105 100644 (file)
@@ -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;
-
 }
-
-