diff options
| author | paco <paco@voltanet.io> | 2018-06-15 16:54:09 +0200 |
|---|---|---|
| committer | paco <paco@voltanet.io> | 2018-06-22 00:06:07 +0200 |
| commit | 764f689bcf8f0d1dbb15d9ff65071bf06e5bfa1e (patch) | |
| tree | afb3cdf029f15e38233b6f9b230d7cdb42e7720c | |
| parent | e4a374681d83a495472500a9a3dbeee12de089f8 (diff) | |
lib: out-of-bounds access (Coverity 1452539)
Signed-off-by: F. Aragon <paco@voltanet.io>
| -rw-r--r-- | lib/sbuf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/sbuf.c b/lib/sbuf.c index 37c1e5283d..03a2be3e09 100644 --- a/lib/sbuf.c +++ b/lib/sbuf.c @@ -63,13 +63,12 @@ void sbuf_push(struct sbuf *buf, int indent, const char *format, ...) int written; if (!buf->fixed) { - char dummy; int written1, written2; size_t new_size; - written1 = snprintf(&dummy, 0, "%*s", indent, ""); + written1 = indent; va_start(args, format); - written2 = vsnprintf(&dummy, 0, format, args); + written2 = vsnprintf(NULL, 0, format, args); va_end(args); new_size = buf->size; |
