Detlef Riekenberg : localspl: Do not crash when Xcv was opened without a space in the name.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Mar 6 06:03:59 CST 2007


Module: wine
Branch: master
Commit: 2253edb7a3981bf8f8367bfca0fac2b254ad2b2d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2253edb7a3981bf8f8367bfca0fac2b254ad2b2d

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Tue Mar  6 05:40:50 2007 +0100

localspl: Do not crash when Xcv was opened without a space in the name.

---

 dlls/localspl/localmon.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c
index 3aa3485..c195c17 100644
--- a/dlls/localspl/localmon.c
+++ b/dlls/localspl/localmon.c
@@ -520,7 +520,13 @@ DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInput
     if (!lstrcmpW(pszDataName, cmd_SetDefaultCommConfigW)) {
         /* get the portname from the Handle */
         ptr =  strchrW(((xcv_t *)hXcv)->nameW, ' ');
-        ptr++;  /* skip the space */
+        if (ptr) {
+            ptr++;  /* skip the space */
+        }
+        else
+        {
+            ptr =  ((xcv_t *)hXcv)->nameW;
+        }
         lstrcpynW(buffer, ptr, sizeof(buffer)/sizeof(WCHAR));
         if (buffer[0]) buffer[lstrlenW(buffer)-1] = '\0';  /* remove the ':' */
         res = SetDefaultCommConfigW(buffer, (LPCOMMCONFIG) pInputData, cbInputData);




More information about the wine-cvs mailing list