Skip to content

Commit f4f34a8

Browse files
committed
WERD_RES: Fix uninitialized member variable
Credit to OSS-Fuzz which reported this issue: pageres.cpp:1143:7: runtime error: load of value 249, which is not a valid value for type 'bool' #0 0x6ba560 in WERD_RES::Clear() tesseract/src/ccstruct/pageres.cpp:1143:7 #1 0x6b9fd1 in WERD_RES::operator=(WERD_RES const&) tesseract/src/ccstruct/pageres.cpp:193:3 #2 0x49a9ad in WERD_RES::WERD_RES(WERD_RES const&) tesseract/src/ccstruct/pageres.h:356:11 See https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13707. Signed-off-by: Stefan Weil <[email protected]>
1 parent afc099b commit f4f34a8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ccstruct/pageres.h

+2
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ class WERD_RES : public ELIST_LINK {
352352
// Deep copies everything except the ratings MATRIX.
353353
// To get that use deep_copy below.
354354
WERD_RES(const WERD_RES& source) : ELIST_LINK(source) {
355+
// combination is used in function Clear which is called from operator=.
356+
combination = false;
355357
InitPointers();
356358
*this = source; // see operator=
357359
}

0 commit comments

Comments
 (0)