From c846dde012a4acca2b9f1b792a5b3af556009ad8 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Thu, 22 Jul 2004 02:32:53 +0000 Subject: [PATCH] - Fix heap corruption on converting ANSI -> UNICODE strings. svn path=/trunk/; revision=10245 --- reactos/lib/user32/windows/messagebox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/lib/user32/windows/messagebox.c b/reactos/lib/user32/windows/messagebox.c index dba2aecd7d7..4b2e4a550de 100644 --- a/reactos/lib/user32/windows/messagebox.c +++ b/reactos/lib/user32/windows/messagebox.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: messagebox.c,v 1.25 2004/04/09 20:03:15 navaraf Exp $ +/* $Id: messagebox.c,v 1.26 2004/07/22 02:32:53 navaraf Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/messagebox.c @@ -733,7 +733,7 @@ MessageBoxIndirectA( * UNICODE_STRING objects are always allocated with an extra byte so you * can null-term if you want */ - textW.Buffer[textW.Length] = L'\0'; + textW.Buffer[textW.Length / sizeof(WCHAR)] = L'\0'; } else textW.Buffer = (LPWSTR)lpMsgBoxParams->lpszText; @@ -745,7 +745,7 @@ MessageBoxIndirectA( * UNICODE_STRING objects are always allocated with an extra byte so you * can null-term if you want */ - captionW.Buffer[captionW.Length] = L'\0'; + captionW.Buffer[captionW.Length / sizeof(WCHAR)] = L'\0'; } else captionW.Buffer = (LPWSTR)lpMsgBoxParams->lpszCaption; @@ -757,7 +757,7 @@ MessageBoxIndirectA( * UNICODE_STRING objects are always allocated with an extra byte so you * can null-term if you want */ - iconW.Buffer[iconW.Length] = L'\0'; + iconW.Buffer[iconW.Length / sizeof(WCHAR)] = L'\0'; } else iconW.Buffer = (LPWSTR)lpMsgBoxParams->lpszIcon;