From 89136a907fcc2ab46ec332e71c1cb4dc478830a9 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 29 Aug 2018 11:20:09 +0300 Subject: some malloc bugs. remove speed sensor noise reduction. --- Software/Embedded_SW/Embedded/Common/protobuf-c/protobuf-c.c | 2 ++ Software/Embedded_SW/Embedded/Common/report/distributor.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Common') diff --git a/Software/Embedded_SW/Embedded/Common/protobuf-c/protobuf-c.c b/Software/Embedded_SW/Embedded/Common/protobuf-c/protobuf-c.c index 5debac820..917022de5 100644 --- a/Software/Embedded_SW/Embedded/Common/protobuf-c/protobuf-c.c +++ b/Software/Embedded_SW/Embedded/Common/protobuf-c/protobuf-c.c @@ -778,6 +778,8 @@ uint32_pack(uint32_t value, uint8_t *out) { unsigned rv = 0; + assert(out > 0); + if (value >= 0x80) { out[rv++] = value | 0x80; value >>= 7; diff --git a/Software/Embedded_SW/Embedded/Common/report/distributor.c b/Software/Embedded_SW/Embedded/Common/report/distributor.c index e587e0575..46a3affd6 100644 --- a/Software/Embedded_SW/Embedded/Common/report/distributor.c +++ b/Software/Embedded_SW/Embedded/Common/report/distributor.c @@ -700,6 +700,7 @@ STATUS ReportMessage2Dist(DistributorHandle distributor, const char *message) * None * */ +char reportmsg[254]; static void messageDistribute(char *msg, int DistTableEntry, @@ -722,11 +723,12 @@ static void messageDistribute(char *msg, Dist_Table[DistTableEntry].dest[index].function(msg,FileName,LineNumber,errorCode,parameter1,parameter2); } */ + strcpy (reportmsg,msg); if (ReportFunc1 != NULL) - ReportFunc1(msg, FileName,LineNumber,errorCode,Severity, parameter); + ReportFunc1(reportmsg, FileName,LineNumber,errorCode,Severity, parameter); if (ReportFunc2 != NULL) - ReportFunc2(msg, FileName,LineNumber,errorCode,Severity, parameter); + ReportFunc2(reportmsg, FileName,LineNumber,errorCode,Severity, parameter); } -- cgit v1.3.1