diff options
author | Rich Megginson <rmeggins@redhat.com> | 2005-03-11 03:47:36 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2005-03-11 03:47:36 +0000 |
commit | 9667f84c94b16d51743bea68df24aeee57bf6f82 (patch) | |
tree | 3e4ac798dc26f0fb3c7883c88d83c5e254f08384 /ldap/admin/lib/dsalib_util.c | |
parent | 5a9fd42bc4bfc2ca4a4fad2f10881ea16cf504ea (diff) | |
download | ds-9667f84c94b16d51743bea68df24aeee57bf6f82.tar.gz ds-9667f84c94b16d51743bea68df24aeee57bf6f82.tar.xz ds-9667f84c94b16d51743bea68df24aeee57bf6f82.zip |
This one is mostly strcpy/strcat checking, checking for null strings before strlen, removing some dead code, other odds and ends.
Diffstat (limited to 'ldap/admin/lib/dsalib_util.c')
-rw-r--r-- | ldap/admin/lib/dsalib_util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ldap/admin/lib/dsalib_util.c b/ldap/admin/lib/dsalib_util.c index 1f8335fa..c17d3747 100644 --- a/ldap/admin/lib/dsalib_util.c +++ b/ldap/admin/lib/dsalib_util.c @@ -290,9 +290,11 @@ ds_get_tmp_dir() if(instanceDir == NULL) { #if defined( XP_WIN32 ) - ilen = strlen(tmp); - GetTempPath( ilen +1, tmp ); + ilen = sizeof(tmp); + GetTempPath( ilen, tmp ); + tmp[ilen-1] = (char)0; /* Remove trailing slash. */ + ilen = strlen(tmp); pch = tmp[ilen-1]; if( pch == '\\' || pch == '/' ) tmp[ilen-1] = '\0'; @@ -642,7 +644,7 @@ alter_startup_line(char *startup_line) char temp_startup_line[BIG_LINE+40]; PR_snprintf(temp_startup_line, sizeof(temp_startup_line), "/bin/sh -c \"%s\"", startup_line); - strcpy(startup_line, temp_startup_line); + PL_strncpyz(startup_line, temp_startup_line, BIG_LINE); #else /* do nothing */ #endif /* Linux */ |