Author: phk
Date: Fri Oct 2 09:23:14 2015
New Revision: 288484
URL: https://svnweb.freebsd.org/changeset/base/288484
Log:
Fail the sbuf if vsnprintf(3) fails.
Modified:
head/sys/kern/subr_sbuf.c
Modified: head/sys/kern/subr_sbuf.c
==============================================================================
--- head/sys/kern/subr_sbuf.c Fri Oct 2 09:03:28 2015 (r288483)
+++ head/sys/kern/subr_sbuf.c Fri Oct 2 09:23:14 2015 (r288484)
@@ -623,6 +623,10 @@ sbuf_vprintf(struct sbuf *s, const char
va_copy(ap_copy, ap);
len = vsnprintf(&s->s_buf[s->s_len], SBUF_FREESPACE(s) + 1,
fmt, ap_copy);
+ if (len < 0) {
+ s->s_error = errno;
+ return (-1);
+ }
va_end(ap_copy);
if (SBUF_FREESPACE(s) >= len)
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"