https://bugs.winehq.org/show_bug.cgi?id=38392
Bug ID: 38392 Summary: Divide by zero in dlls/user32/Edit.c source file Product: Wine Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: bur_av@bk.ru Distribution: ---
Upon calculation of line count in get_vertical_line_count function, line_height field might take value of 0, which results in division by zero error. E.g. I encountered this when dynamically creating hidden text control in Clarion language, which uses WinAPI call for that.
Here's my hotfix for this bug (return 1 if es->line_height <= 0):
{{{ static inline INT get_vertical_line_count(EDITSTATE *es) { if (es->line_height <=0) { return 1; } else { INT vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height; return max(1,vlc); } } }}}
The problem shows up in WINE versions 1.4.1 - 1.7.40. (at least on CentOS 6, CentOS 7, Debian 7 and Mint 17).
Please, fix this bug in official release.
https://bugs.winehq.org/show_bug.cgi?id=38392
nallekarhu_80@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nallekarhu_80@luukku.com
--- Comment #1 from nallekarhu_80@luukku.com --- Can you figure any test application for this?
https://bugs.winehq.org/show_bug.cgi?id=38392
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |focht@gmx.net Version|unspecified |1.4.1 Resolution|--- |DUPLICATE Summary|Divide by zero in |Divide by zero in |dlls/user32/Edit.c source |dlls/user32/Edit.c source |file |file (encountered with | |Clarion TX Control wrapper)
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello folks,
dupe of bug 19239
Also try to put at least the application name and version to reproduce with in the bug summary.
Regards
*** This bug has been marked as a duplicate of bug 19239 ***
https://bugs.winehq.org/show_bug.cgi?id=38392
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Austin English austinenglish@gmail.com --- Closing.