Jörg Höhle : winmm: Do not crash on NULL MCI Sysinfo command output buffer pointer.

Alexandre Julliard julliard at winehq.org
Thu Nov 5 10:50:03 CST 2009


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

Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date:   Sun Oct 18 18:41:10 2009 +0200

winmm: Do not crash on NULL MCI Sysinfo command output buffer pointer.

---

 dlls/winmm/mci.c       |    4 ++--
 dlls/winmm/tests/mci.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c
index e28a298..c6f3701 100644
--- a/dlls/winmm/mci.c
+++ b/dlls/winmm/mci.c
@@ -1746,8 +1746,8 @@ static	DWORD MCI_SysInfo(UINT uDevID, DWORD dwFlags, LPMCI_SYSINFO_PARMSW lpParm
     LPWINE_MCIDRIVER	wmd;
     HKEY		hKey;
 
-    if (lpParms == NULL || lpParms->lpstrReturn == NULL)
-        return MCIERR_NULL_PARAMETER_BLOCK;
+    if (lpParms == NULL)			return MCIERR_NULL_PARAMETER_BLOCK;
+    if (lpParms->lpstrReturn == NULL)		return MCIERR_PARAM_OVERFLOW;
 
     TRACE("(%08x, %08X, %p[num=%d, wDevTyp=%u])\n",
 	  uDevID, dwFlags, lpParms, lpParms->dwNumber, lpParms->wDeviceType);
diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c
index 4151664..59cf4ae 100644
--- a/dlls/winmm/tests/mci.c
+++ b/dlls/winmm/tests/mci.c
@@ -511,7 +511,7 @@ static void test_AutoOpenWAVE(HWND hwnd)
 
     /* Do not crash on NULL buffer pointer */
     err = mciSendString("sysinfo waveaudio quantity open", NULL, 0, NULL);
-    todo_wine ok(err==MCIERR_PARAM_OVERFLOW,"mci sysinfo without buffer returned error: %d\n", err);
+    ok(err==MCIERR_PARAM_OVERFLOW,"mci sysinfo without buffer returned error: %d\n", err);
 
     err = mciSendString("sysinfo waveaudio quantity open", buf, sizeof(buf), NULL);
     ok(!err,"mci sysinfo waveaudio quantity open returned error: %d\n", err);




More information about the wine-cvs mailing list