Commit fe1ec6da authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Fail the VSB if vsnprintf(3) fails.

parent fd51c52f
......@@ -350,6 +350,10 @@ VSB_vprintf(struct vsb *s, const char *fmt, va_list ap)
va_copy(ap_copy, ap);
len = vsnprintf(&s->s_buf[s->s_len], VSB_FREESPACE(s) + 1,
fmt, ap_copy);
if (len < 0) {
s->s_error = errno;
return (-1);
}
va_end(ap_copy);
} while (len > VSB_FREESPACE(s) &&
VSB_extend(s, len - VSB_FREESPACE(s)) == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment