Skip to content

Commit a3a8cf2

Browse files
committed
ccan: Change vsprintfs to vsnprintfs
1 parent af5d02a commit a3a8cf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ccan/ccan/json_out/json_out.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct json_out {
99
/* Callback if we reallocate. */
1010
void (*move_cb)(struct json_out *jout, ptrdiff_t delta, void *arg);
1111
void *cb_arg;
12-
12+
1313
#ifdef CCAN_JSON_OUT_DEBUG
1414
/* tal_arr of types ( or [ we're enclosed in. NULL if oom. */
1515
char *wrapping;
@@ -246,7 +246,7 @@ bool json_out_addv(struct json_out *jout,
246246
dst = mkroom(jout, fmtlen + 1 + (int)quote*2);
247247
if (!dst)
248248
goto out;
249-
vsprintf(dst + quote, fmt, ap2);
249+
vsnprintf(dst + quote, fmtlen + 1, fmt, ap2);
250250
}
251251

252252
#ifdef CCAN_JSON_OUT_DEBUG

0 commit comments

Comments
 (0)