Skip to content

Commit

Permalink
Don't dereference a null pointer
Browse files Browse the repository at this point in the history
Fixes #564

I don't actually believe such a file can be created through normal means. I imagine this was created by a 3rd party tool, probably by some instrument manufacturer. But checking for a null pointer here doesn't seem to be actively harmful.
  • Loading branch information
jennybc committed Mar 19, 2022
1 parent 720ce9d commit b43ab60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/XlsWorkBook.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class XlsWorkBook {
if (n_formats > 0) {
for (int i = 0; i < n_formats; ++i) {
const xls::st_format::st_format_data format = pWB->formats.format[i];
if (format.value == nullptr) {
continue;
}
// format.value = format string
// in xlsx, this is formatCode
std::string code((char*) format.value);
Expand Down

0 comments on commit b43ab60

Please sign in to comment.