Output: Fix invalid pointer dereferencing in vcd and gnuplot.
This commit is contained in:
parent
bdfc7a8974
commit
e273a9040e
|
@ -134,6 +134,9 @@ static int data(struct output *o, char *data_in, uint64_t length_in,
|
||||||
char *outbuf, *c;
|
char *outbuf, *c;
|
||||||
|
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
|
|
||||||
|
outsize = 0;
|
||||||
|
if (ctx->header)
|
||||||
outsize = strlen(ctx->header);
|
outsize = strlen(ctx->header);
|
||||||
outbuf = calloc(1, outsize + 1 + 10000); /* FIXME: Use realloc(). */
|
outbuf = calloc(1, outsize + 1 + 10000); /* FIXME: Use realloc(). */
|
||||||
if (outbuf == NULL)
|
if (outbuf == NULL)
|
||||||
|
|
|
@ -143,6 +143,8 @@ static int data(struct output *o, char *data_in, uint64_t length_in,
|
||||||
char *outbuf, *c;
|
char *outbuf, *c;
|
||||||
|
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
|
outsize = 0;
|
||||||
|
if (ctx->header)
|
||||||
outsize = strlen(ctx->header);
|
outsize = strlen(ctx->header);
|
||||||
outbuf = calloc(1, outsize + 1 + 10000); /* FIXME: Use realloc(). */
|
outbuf = calloc(1, outsize + 1 + 10000); /* FIXME: Use realloc(). */
|
||||||
if (outbuf == NULL)
|
if (outbuf == NULL)
|
||||||
|
|
Loading…
Reference in New Issue