Changeset b857151 in rtems-tools


Ignore:
Timestamp:
Aug 26, 2017, 8:15:52 AM (2 years ago)
Author:
Hermann Felbinger <hermann19829@…>
Branches:
master
Children:
cb018bc
Parents:
05b4cfb
git-author:
Hermann Felbinger <hermann19829@…> (08/26/17 08:15:52)
git-committer:
Chris Johns <chrisj@…> (08/29/17 08:05:38)
Message:

covoar: Fix buffer overflow and fix br tag in html report.

Co-Author: Krzysztof Miesowicz <krzysztof.miesowicz@…>

Location:
tester/covoar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tester/covoar/ReportsBase.cc

    r05b4cfb rb857151  
    211211         itr++ ) {
    212212
    213       uint32_t     id = 0;
    214       std::string  annotation = "";
    215       std::string  line;
    216       char         textLine[150];
     213      uint32_t           id = 0;
     214      std::string        annotation = "";
     215      std::string        line;
     216      const std::size_t  LINE_LENGTH = 150;
     217      char               textLine[LINE_LENGTH];
    217218
    218219      state = A_SOURCE;
     
    237238      }
    238239
    239       sprintf( textLine, "%-70s", itr->line.c_str() );
     240      snprintf( textLine, LINE_LENGTH, "%-70s", itr->line.c_str() );
    240241      line = textLine + annotation;
    241242
  • tester/covoar/ReportsHtml.cc

    r05b4cfb rb857151  
    5353       fprintf( \
    5454         aFile, \
    55          "<li>%s (<a href=\"%s\">text</a>)\n", \
     55         "<li>%s (<a href=\"%s\">text</a>)</li>\n", \
    5656        _t, _n );
    5757
     
    7070      fprintf(
    7171        aFile,
    72          "%s</br>",
     72         "%s<br>",
    7373         projectName
    7474      );
     
    9494    fprintf(
    9595      aFile,
    96       "</li>\n"
     96      "</ul>\n"
    9797      "<!-- INSERT PROJECT SPECIFIC ITEMS HERE -->\n"
    9898      "</html>\n"
     
    145145      fprintf(
    146146        aFile,
    147          "%s</br>",
     147         "%s<br>",
    148148         projectName
    149149      );
     
    182182        fprintf(
    183183          aFile,
    184           "%s</br>",
     184          "%s<br>",
    185185          projectName
    186186        );
     
    198198        "<th class=\"table-sortable:default\" align=\"left\">Line</th>\n"
    199199        "<th class=\"table-filterable table-sortable:default\" align=\"left\">File</th>\n"
    200         "<th class=\"table-sortable:numeric\" align=\"left\">Size </br>Bytes</th>\n"
     200        "<th class=\"table-sortable:numeric\" align=\"left\">Size <br>Bytes</th>\n"
    201201        "<th class=\"table-sortable:default\" align=\"left\">Reason</th>\n"
    202202        "<th class=\"table-filterable table-sortable:default\" align=\"left\">Taken</th>\n"
     
    233233      fprintf(
    234234        aFile,
    235         "%s</br>",
     235        "%s<br>",
    236236        projectName
    237237      );
     
    249249      "<th class=\"table-sortable:default\" align=\"left\">Range</th>\n"
    250250      "<th class=\"table-filterable table-sortable:default\" align=\"left\">File</th>\n"
    251       "<th class=\"table-sortable:numeric\" align=\"left\">Size </br>Bytes</th>\n"
    252       "<th class=\"table-sortable:numeric\" align=\"left\">Size </br>Instructions</th>\n"
     251      "<th class=\"table-sortable:numeric\" align=\"left\">Size <br>Bytes</th>\n"
     252      "<th class=\"table-sortable:numeric\" align=\"left\">Size <br>Instructions</th>\n"
    253253      "<th class=\"table-filterable table-sortable:default\" align=\"left\">Classification</th>\n"
    254254      "<th class=\"table-sortable:default\" align=\"left\">Explanation</th>\n"
     
    282282      fprintf(
    283283        aFile,
    284         "%s</br>",
     284        "%s<br>",
    285285        projectName
    286286      );
     
    327327      fprintf(
    328328        aFile,
    329         "%s</br>",
     329        "%s<br>",
    330330        projectName
    331331      );
     
    372372      fprintf(
    373373        aFile,
    374         "%s</br>",
     374        "%s<br>",
    375375        projectName
    376376      );
     
    386386      "<tr>\n"
    387387      "<th class=\"table-sortable:default\" align=\"center\">Symbol</th>\n"
    388       "<th class=\"table-sortable:numeric\" align=\"center\">Total</br>Size</br>Bytes</th>\n"
    389       "<th class=\"table-sortable:numeric\" align=\"center\">Total</br>Size</br>Instr</th>\n"
    390       "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Ranges</th>\n"
    391       "<th class=\"table-sortable:numeric\" align=\"center\">Uncovered</br>Size</br>Bytes</th>\n"
    392       "<th class=\"table-sortable:numeric\" align=\"center\">Uncovered</br>Size</br>Instr</th>\n"
    393       "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Branches</th>\n"
    394       "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Always</br>Taken</th>\n"
    395       "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Never</br>Taken</th>\n"
    396       "<th class=\"table-sortable:numeric\" align=\"center\">Percent</br>Uncovered</br>Instructions</th>\n"
    397       "<th class=\"table-sortable:numeric\" align=\"center\">Percent</br>Uncovered</br>Bytes</th>\n"
     388      "<th class=\"table-sortable:numeric\" align=\"center\">Total<br>Size<br>Bytes</th>\n"
     389      "<th class=\"table-sortable:numeric\" align=\"center\">Total<br>Size<br>Instr</th>\n"
     390      "<th class=\"table-sortable:numeric\" align=\"center\">#<br>Ranges</th>\n"
     391      "<th class=\"table-sortable:numeric\" align=\"center\">Uncovered<br>Size<br>Bytes</th>\n"
     392      "<th class=\"table-sortable:numeric\" align=\"center\">Uncovered<br>Size<br>Instr</th>\n"
     393      "<th class=\"table-sortable:numeric\" align=\"center\">#<br>Branches</th>\n"
     394      "<th class=\"table-sortable:numeric\" align=\"center\">#<br>Always<br>Taken</th>\n"
     395      "<th class=\"table-sortable:numeric\" align=\"center\">#<br>Never<br>Taken</th>\n"
     396      "<th class=\"table-sortable:numeric\" align=\"center\">Percent<br>Uncovered<br>Instructions</th>\n"
     397      "<th class=\"table-sortable:numeric\" align=\"center\">Percent<br>Uncovered<br>Bytes</th>\n"
    398398      "</tr>\n"
    399399      "</thead>\n"
     
    729729    fprintf(
    730730      report,
    731       "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%s </br>%s</td>\n",
     731      "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%s <br>%s</td>\n",
    732732      rangePtr->id,   
    733733      rangePtr->lowSourceLine.c_str(),
Note: See TracChangeset for help on using the changeset viewer.