Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New buffer size warning in UT assert #534

Closed
jphickey opened this issue Jul 8, 2020 · 0 comments · Fixed by #535 or #529
Closed

New buffer size warning in UT assert #534

jphickey opened this issue Jul 8, 2020 · 0 comments · Fixed by #535 or #529
Assignees
Labels
bug unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Jul 8, 2020

Describe the bug
After moving the UtAssert_DoTestSegmentReport() function, it has triggered a new warning when building with optimization enabled (BUILDTYPE=release).

/home/joe/code/cfecfs/github-cfs-bundle/osal/ut_assert/src/utassert.c:82:20: error: ‘%-20s’ directive output may be truncated writing between 20 and 127 bytes into a region of size between 117 and 125 [-Werror=format-truncation=]
   82 |              "%02u %-20s TOTAL::%-4u  PASS::%-4u  FAIL::%-4u   MIR::%-4u   TSF::%-4u   N/A::%-4u\n",

To Reproduce
Build with GCC9+ and BUILDTYPE=release flag.

Expected behavior
Should build cleanly.

System observed on:
Ubuntu 20.04

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Jul 8, 2020
jphickey added a commit to jphickey/osal that referenced this issue Jul 8, 2020
Avoids a possible truncation in snprintf call.
astrogeco added a commit that referenced this issue Jul 8, 2020
@astrogeco astrogeco added this to the v5.1.0 milestone Sep 21, 2020
@astrogeco astrogeco added bug unit-test Tickets related to the OSAL unit testing (functional and/or coverage) labels Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
2 participants