Skip to content

Commit

Permalink
Fix potential crash in STRING class
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Nov 30, 2018
1 parent b6057f5 commit 6b6d9de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ccutil/strngs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ int32_t STRING::length() const {

const char* STRING::string() const {
const STRING_HEADER* header = GetHeader();
if (header->used_ == 0)
if (!header || header->used_ == 0)
return nullptr;

// mark header length unreliable because tesseract might
Expand Down

0 comments on commit 6b6d9de

Please sign in to comment.