Open petrufm opened 6 years ago
Hi,
While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "sfntly/cpp/src/sfntly/font.cc" line 426 function Font::Builder::InterRelateBuilders(TableBuilderMap* builder_map):
Table::Builder raw_hhea_builder = GetReadBuilder(builder_map, Tag::hhea); HorizontalHeaderTableBuilderPtr horizontal_header_builder; if (raw_head_builder != NULL) { //HERE horizontal_header_builder = down_cast<HorizontalHeaderTable::Builder>(raw_hhea_builder); }
Shouldn't you test for not being null the raw_hhea_builder variable? The one you test here is already tested in line 419.
Thanks, Petru Florin Mihancea
This project is abandoned, please see https://github.com/rillig/sfntly
Hi,
While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "sfntly/cpp/src/sfntly/font.cc" line 426 function Font::Builder::InterRelateBuilders(TableBuilderMap* builder_map):
Table::Builder raw_hhea_builder = GetReadBuilder(builder_map, Tag::hhea); HorizontalHeaderTableBuilderPtr horizontal_header_builder; if (raw_head_builder != NULL) { //HERE horizontal_header_builder = down_cast<HorizontalHeaderTable::Builder>(raw_hhea_builder); }
Shouldn't you test for not being null the raw_hhea_builder variable? The one you test here is already tested in line 419.
Thanks, Petru Florin Mihancea