From bafe54e7e515d88cd3cd3a7b7cdb64222fe9afd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Sat, 17 Nov 2012 22:49:49 +0100 Subject: [PATCH] advpack: Fix possible NULL pointer access in heap_strdupWtoA. --- dlls/advpack/advpack_private.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/advpack/advpack_private.h b/dlls/advpack/advpack_private.h index a1bcfe44eb0..5d7489778d6 100644 --- a/dlls/advpack/advpack_private.h +++ b/dlls/advpack/advpack_private.h @@ -44,7 +44,8 @@ static inline char *heap_strdupWtoA(const WCHAR *str) if(str) { size_t size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); ret = heap_alloc(size); - WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL); + if(ret) + WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL); } return ret;