Skip to content

Commit

Permalink
Fix #534, adjust UT assert buffer sizes
Browse files Browse the repository at this point in the history
Avoids a possible truncation in snprintf call.
  • Loading branch information
jphickey committed Jul 8, 2020
1 parent 80fdd67 commit 2ad28d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ut_assert/src/utassert.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
UtAssert_CaseType_t DefaultContext = UTASSERT_CASETYPE_FAILURE;
UtAssert_TestCounter_t UT_SegmentCounters = { 0 };
UtAssert_TestCounter_t UT_TotalCounters = { 0 };
static char CurrentSegment[128];
static char CurrentSegment[64];

/*
* Function Definitions
Expand Down Expand Up @@ -76,7 +76,7 @@ void UtAssert_DoReport(const char *File, uint32 LineNum, uint32 SegmentNum, uint

void UtAssert_DoTestSegmentReport(const char *SegmentName, const UtAssert_TestCounter_t *TestCounters)
{
char ReportBuffer[128];
char ReportBuffer[144];

snprintf(ReportBuffer, sizeof(ReportBuffer),
"%02u %-20s TOTAL::%-4u PASS::%-4u FAIL::%-4u MIR::%-4u TSF::%-4u N/A::%-4u\n",
Expand Down

0 comments on commit 2ad28d0

Please sign in to comment.