From 28a1de8141b4483249fc4d39c5414d343037a7dd Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Thu, 25 Feb 2010 22:13:11 +0000 Subject: [PATCH] VCD: Fixed a buffer overflow In case we're dumping 32 bits wide traces (!) Signed-off-by: Michel Pollet --- simavr/sim/sim_vcd_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"); -- 2.39.5