PATCH wine/controls/button.c paint_button() : "style" range checking

Alexandre Julliard julliard at
Wed Feb 18 16:25:14 CST 2004

Vincent Pelletier <subdino2004 at> writes:

> Checks for out-of-range value in "style" (paint_button function):
> must be style<MAX_BTN_TYPE or memory violation (reading unpredictable
> btyes) occurs, and as it's then used as a function address that could
> lead to random code execution.

If you really want an assertion you should use assert(), at least then
it can be compiled out. And if it's a condition that can legitimately
happen, then it has to be handled properly, just adding an ERR doesn't
improve anything.  In this case I guess it's conceivable that the app
would change the style to an invalid one, so it needs to be handled.

Alexandre Julliard
julliard at

More information about the wine-devel mailing list