diff options
author | Hermann Felbinger <hermann19829@gmail.com> | 2017-08-26 09:15:52 +0100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2017-08-29 18:05:38 +1000 |
commit | b857151112fe5ae05f20447e2598123a3bce1657 (patch) | |
tree | 9673fe3fecc4b81f64ee553bb89adbf4960c7314 /tester/covoar/ReportsBase.cc | |
parent | covoar/qemu-traces.h: Change to match current couverture-qemu file. (diff) | |
download | rtems-tools-b857151112fe5ae05f20447e2598123a3bce1657.tar.bz2 |
covoar: Fix buffer overflow and fix br tag in html report.
Co-Author: Krzysztof Miesowicz <krzysztof.miesowicz@gmail.com>
Diffstat (limited to 'tester/covoar/ReportsBase.cc')
-rw-r--r-- | tester/covoar/ReportsBase.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc index b61fc76..01950d0 100644 --- a/tester/covoar/ReportsBase.cc +++ b/tester/covoar/ReportsBase.cc @@ -210,10 +210,11 @@ void ReportsBase::WriteAnnotatedReport( itr != theInstructions->end(); itr++ ) { - uint32_t id = 0; - std::string annotation = ""; - std::string line; - char textLine[150]; + uint32_t id = 0; + std::string annotation = ""; + std::string line; + const std::size_t LINE_LENGTH = 150; + char textLine[LINE_LENGTH]; state = A_SOURCE; @@ -236,7 +237,7 @@ void ReportsBase::WriteAnnotatedReport( } } - sprintf( textLine, "%-70s", itr->line.c_str() ); + snprintf( textLine, LINE_LENGTH, "%-70s", itr->line.c_str() ); line = textLine + annotation; PutAnnotatedLine( aFile, state, line, id); |