summaryrefslogtreecommitdiffstats
path: root/ldap/admin/lib/dsalib_debug.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-11 03:47:36 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-11 03:47:36 +0000
commit9667f84c94b16d51743bea68df24aeee57bf6f82 (patch)
tree3e4ac798dc26f0fb3c7883c88d83c5e254f08384 /ldap/admin/lib/dsalib_debug.c
parent5a9fd42bc4bfc2ca4a4fad2f10881ea16cf504ea (diff)
downloadds-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_debug.c')
-rw-r--r--ldap/admin/lib/dsalib_debug.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ldap/admin/lib/dsalib_debug.c b/ldap/admin/lib/dsalib_debug.c
index 797b84dc..5c777845 100644
--- a/ldap/admin/lib/dsalib_debug.c
+++ b/ldap/admin/lib/dsalib_debug.c
@@ -11,6 +11,7 @@
#include <string.h>
#include <stdlib.h>
#include "nspr.h"
+#include "plstr.h"
#if defined( XP_WIN32 )
int ldap_debug = 0;
@@ -23,8 +24,7 @@ ds_log_env(char **envp)
char admin_logfile[PATH_MAX], *tmp_dir;
tmp_dir = ds_get_tmp_dir();
- memset( admin_logfile, 0, sizeof( admin_logfile ) );
- strcat( admin_logfile, tmp_dir );
+ PL_strncpyz( admin_logfile, tmp_dir, sizeof(admin_logfile) );
#if defined( XP_WIN32 )
if( tmp_dir )
{
@@ -32,7 +32,7 @@ ds_log_env(char **envp)
tmp_dir = NULL;
}
#endif
- strcat( admin_logfile, "/admin.log");
+ PL_strcatn( admin_logfile, sizeof(admin_logfile), "/admin.log");
file = fopen(admin_logfile, "a+");
if (file != NULL) {
@@ -55,7 +55,7 @@ ds_log_debug_message(char *msg)
tmp_dir = ds_get_tmp_dir();
memset( admin_logfile, 0, sizeof( admin_logfile ) );
- strcat( admin_logfile, tmp_dir );
+ PL_strncpyz( admin_logfile, tmp_dir, sizeof(admin_logfile) );
#if defined( XP_WIN32 )
if( tmp_dir )
{
@@ -63,7 +63,7 @@ ds_log_debug_message(char *msg)
tmp_dir = NULL;
}
#endif
- strcat( admin_logfile, "/admin.log");
+ PL_strcatn( admin_logfile, sizeof(admin_logfile), "/admin.log");
file = fopen(admin_logfile, "a+");
if (file != NULL) {