http://bugs.winehq.org/show_bug.cgi?id=59926 --- Comment #6 from James M <f0rm4tm3@gmail.com> --- Thanks for the review. You're right — the test in the first patch didn't exercise the NULL start case; that case was only added in the second patch alongside the fix, so it could never demonstrate the bug on its own. Revised series attached: #81270 — kernelbase/tests: Add tests for CharPrevA. #81271 — kernelbase: Don't dereference NULL in CharPrevA/CharPrevExA. The test commit now drives the NULL-start path directly: it calls CharPrevA() and CharPrevExA() with start == NULL and a real, non-NULL current pointer (str + 1), rather than the degenerate start == ptr boundary. The return value is captured once so the ok() message doesn't re-invoke the function. Without the fix this NULL dereference crashes the test process; with the fix both calls return NULL and the assertions pass. The second patch is now the implementation change only (the two `if (!start) return NULL;` guards) — no test lines — so the split is test-then-fix as intended. Both patches apply cleanly with `git am` on current master. The earlier attachments (#81264, #81265) are marked obsolete. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.