From: Michel Pollet Date: Thu, 25 Feb 2010 22:13:11 +0000 (+0000) Subject: VCD: Fixed a buffer overflow X-Git-Tag: v1.0a1~5 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=28a1de8141b4483249fc4d39c5414d343037a7dd;p=sx%2Fsimavr.git VCD: Fixed a buffer overflow In case we're dumping 32 bits wide traces (!) Signed-off-by: Michel Pollet --- diff --git a/simavr/sim/sim_vcd_file.c b/simavr/sim/sim_vcd_file.c index 411b6b8..612be56 100644 --- a/simavr/sim/sim_vcd_file.c +++ b/simavr/sim/sim_vcd_file.c @@ -87,7 +87,7 @@ static void avr_vcd_flush_log(avr_vcd_t * vcd) return; // printf("avr_vcd_flush_log %d\n", vcd->logindex); uint32_t oldbase = 0; // make sure it's different - char out[32]; + char out[48]; #if AVR_VCD_MAX_SIGNALS > 32 uint64_t seen = 0; @@ -163,7 +163,7 @@ int avr_vcd_start(avr_vcd_t * vcd) fprintf(vcd->output, "$dumpvars\n"); for (int i = 0; i < vcd->signal_count; i++) { avr_vcd_signal_t * s = &vcd->signal[i]; - char out[32]; + char out[48]; fprintf(vcd->output, "%s\n", _avr_vcd_get_signal_text(s, out, s->irq.value)); } fprintf(vcd->output, "$end\n");