mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#722: disallow argument buffer overflow
This commit is contained in:
parent
d8c4df6f39
commit
6a3b8e281b
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user