Skip to content

Commit

Permalink
Fix CID 1395108 (Dereference after null check)
Browse files Browse the repository at this point in the history
Let's hope that word->best_choice is never NULL.
Overwise both the old and the new code would abort with SIGSEGV.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Aug 22, 2018
1 parent 6092a8f commit f3c7a17
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/ccmain/adaptions.cpp
Expand Up @@ -37,7 +37,6 @@ bool Tesseract::word_adaptable( //should we adapt?
uint16_t mode) {
if (tessedit_adaption_debug) {
tprintf("Running word_adaptable() for %s rating %.4f certainty %.4f\n",
word->best_choice == nullptr ? "" :
word->best_choice->unichar_string().string(),
word->best_choice->rating(), word->best_choice->certainty());
}
Expand Down

0 comments on commit f3c7a17

Please sign in to comment.