user32: Fix wsprintfA's buffer usage when using %S.
commit8baf70a2d04d227de28452c819c48f3bfd5171a4
authorAkihiro Sagawa <sagawa.aki@gmail.com>
Sun, 2 Aug 2020 10:39:58 +0000 (2 19:39 +0900)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 3 Aug 2020 08:21:57 +0000 (3 10:21 +0200)
tree18a1b44ab81419589d22122608c90e55f78433d7
parent31800a1414a33995eba7c89d65a93d69beee47b3
user32: Fix wsprintfA's buffer usage when using %S.

This fixes a regression introduced by
08bf605acb4d319e016a7eafe0c675509445bd4a.
It could lead to stack corruption because ret can be negative when the
output position, p, doesn't point the beginning of the buffer before
the inner loop.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/user32/wsprintf.c