From d57fe5ccdf096b2cfe3973afc78f51ec48f62b77 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 22 Apr 2014 11:21:53 +0000 Subject: Fixed bug #472. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6877 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/various/chprintf.c | 8 ++++---- readme.txt | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/os/various/chprintf.c b/os/various/chprintf.c index 08d313dac..8c709bc4f 100644 --- a/os/various/chprintf.c +++ b/os/various/chprintf.c @@ -246,12 +246,12 @@ unsigned_common: chSequentialStreamPut(chp, (uint8_t)*s++); i--; } - do + do { chSequentialStreamPut(chp, (uint8_t)filler); - while (++width != 0); + } while (++width != 0); } - chSequentialStreamWrite(chp, (uint8_t*)s, i); - s += i; + while (--i >= 0) + chSequentialStreamPut(chp, (uint8_t)*s++); while (width) { chSequentialStreamPut(chp, (uint8_t)filler); diff --git a/readme.txt b/readme.txt index e486f007f..e7afb49cb 100644 --- a/readme.txt +++ b/readme.txt @@ -112,6 +112,8 @@ (backported to 2.6.4). - FIX: Fixed wrong TIM1 and TIM8 macros in STM32F30x HAL driver (bug #473) (backported to 2.6.4). +- FIX: Fixed chprintf()/chSequentialStreamWrite() crash with size of 0 + or NULL (bug #472)(backported to 2.6.4). - FIX: Fixed STM32 SDC driver clock activation issue (bug #464)(backported to - FIX: Fixed simulated IO message is corrupted in simulator (bug #468) (backported to 2.6.4). -- cgit v1.2.3