http://bugs.winehq.org/show_bug.cgi?id=58320
Bug ID: 58320 Summary: ok() macro should not evaluate the format arguments if condition is not met. Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: testcases Assignee: wine-bugs@winehq.org Reporter: yshuiv7@gmail.com Distribution: ---
While running the test suite under ASan I noticed in several instances where the format arguments given to the ok() macro is only safe to evaluate if the test case has failed.
One such example is in bcrypt/tests: https://gitlab.winehq.org/wine/wine/-/blob/d9148e48a3257ae80361f02f0bb7a2d60...
accessing `buffer[i]` is only safe if the test `i == sizeof(buffer)` has failed, and if the test case passes, we will access `buffer` out-of-bound.