summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-15 09:26:01 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-15 09:26:01 +0000
commite42c9458c2f1e3a78d6d45e99741d6edb38fc0cc (patch)
tree4ebc43570cdd5f3fe11dd189aaf3cbb3b4968be2 /log.c
parent087bf010d2cd89848181e49b4ecdfd29a66353e9 (diff)
downloadrsync-e42c9458c2f1e3a78d6d45e99741d6edb38fc0cc.tar.gz
rsync-e42c9458c2f1e3a78d6d45e99741d6edb38fc0cc.tar.bz2
rsync-e42c9458c2f1e3a78d6d45e99741d6edb38fc0cc.zip
use strlcat() strlcpy() and slprintf() whenever possible to avoid any
chance of a buffer overflow
Diffstat (limited to 'log.c')
-rw-r--r--log.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/log.c b/log.c
index 068b5a93..8be3605a 100644
--- a/log.c
+++ b/log.c
@@ -23,6 +23,7 @@
*/
#include "rsync.h"
+
/* this is the rsync debugging function. Call it with FINFO or FERROR */
void rprintf(int fd, const char *format, ...)
{
@@ -33,13 +34,7 @@ void rprintf(int fd, const char *format, ...)
extern int am_daemon;
va_start(ap, format);
-
-#if HAVE_VSNPRINTF
- len = vsnprintf(buf, sizeof(buf)-1, format, ap);
-#else
- vsprintf(buf, format, ap);
- len = strlen(buf);
-#endif
+ len = vslprintf(buf, sizeof(buf)-1, format, ap);
va_end(ap);
if (len < 0) exit_cleanup(1);