Wolfram Sang : hhctrl: Add check for no filename.
Alexandre Julliard
julliard at winehq.org
Tue Oct 5 14:41:48 CDT 2010
Module: wine
Branch: stable
Commit: d40f6132d574e076bedcdb2b665d829806a6c68e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d40f6132d574e076bedcdb2b665d829806a6c68e
Author: Wolfram Sang <wolfram at the-dreams.de>
Date: Wed Sep 8 16:23:47 2010 +0200
hhctrl: Add check for no filename.
(cherry picked from commit 9e1d9ef972f65e292e7b00e1da9293271bc60486)
---
dlls/hhctrl.ocx/hhctrl.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c
index 9ab66de..2101e05 100644
--- a/dlls/hhctrl.ocx/hhctrl.c
+++ b/dlls/hhctrl.ocx/hhctrl.c
@@ -295,6 +295,9 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
ptr += strlen("mapid")+1;
space = strchr(ptr, ' ');
+ /* command line ends without number */
+ if (!space)
+ return 0;
memcpy(idtxt, ptr, space-ptr);
idtxt[space-ptr] = '\0';
mapid = atoi(idtxt);
@@ -315,6 +318,11 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
len = endq - szCmdLine;
else
len = strlen(szCmdLine);
+
+ /* no filename given */
+ if (!len)
+ return 0;
+
buflen = MultiByteToWideChar(CP_ACP, 0, szCmdLine, len, NULL, 0) + 1;
filename = heap_alloc(buflen * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szCmdLine, len, filename, buflen);
More information about the wine-cvs
mailing list