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