From e795dfb15be345bf9c097e5196b28b3e9f5a19dc Mon Sep 17 00:00:00 2001 From: gj Date: Sun, 25 Feb 2001 19:52:42 +0000 Subject: Use vsnprintf in logmsg() to avoid overflowing the array on the stack. The problem was noted with an older model 3Com 3C589 which seems to return more than 256 bytes of data. --- usr.sbin/pccard/pccardd/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.sbin/pccard') diff --git a/usr.sbin/pccard/pccardd/util.c b/usr.sbin/pccard/pccardd/util.c index 951d66a..8f9a48d 100644 --- a/usr.sbin/pccard/pccardd/util.c +++ b/usr.sbin/pccard/pccardd/util.c @@ -69,7 +69,7 @@ logmsg(const char *fmt, ...) char s[256]; va_start(ap, fmt); - vsprintf(s, fmt, ap); + vsnprintf(s, 256, fmt, ap); if (do_log) syslog(LOG_ERR, "%s", s); -- cgit v1.1