use strlcat() strlcpy() and slprintf() whenever possible to avoid any

chance of a buffer overflow
This commit is contained in:
Andrew Tridgell
1998-05-15 09:26:01 +00:00
parent 087bf010d2
commit e42c9458c2
9 changed files with 118 additions and 44 deletions

8
io.c
View File

@@ -521,13 +521,7 @@ void io_printf(int fd, const char *format, ...)
int len;
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);