Skip to content

Commit 6b6d9de

Browse files
committed
Fix potential crash in STRING class
Signed-off-by: Stefan Weil <[email protected]>
1 parent b6057f5 commit 6b6d9de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ccutil/strngs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ int32_t STRING::length() const {
195195

196196
const char* STRING::string() const {
197197
const STRING_HEADER* header = GetHeader();
198-
if (header->used_ == 0)
198+
if (!header || header->used_ == 0)
199199
return nullptr;
200200

201201
// mark header length unreliable because tesseract might

0 commit comments

Comments
 (0)