You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Isn't it normal that API functions will do weird things or even crash if they are called with illegal values? Would you expect that strcpy or other functions of the standard C library also work with nullptr arguments?
I don't think there is an integer overflow. You call the function with a negative argument which is not a valid PSM value, and the function compares this int argument with an enum value. For invalid arguments any result is okay.
Hi! While testing with Tesseract APIs we spotted some issues that might lead to undefined behaviors.
An API call sequence:
would crash at
tesseract/src/api/baseapi.cpp
Line 1837 in 46b9904
under address sanitizer due to not checking if
wordstr
is a valid pointer.Also, it reaches there due to an integer overflow in:
tesseract/include/tesseract/publictypes.h
Lines 186 to 188 in 46b9904
if the second argument
PageSegMode
inTessBaseAPIAdaptToWordStr
is negative and makesPSM_OSD_ENABLED
wrongly returntrue
.The text was updated successfully, but these errors were encountered: