[PATCH] winmm: Cope with empty string in mciSendString
Andrew Eikum
aeikum at codeweavers.com
Thu Mar 2 08:29:11 CST 2017
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
On Wed, Mar 01, 2017 at 01:18:20AM -0300, Bruno Jesus wrote:
> From: Bruno Jesus <bjesus at codeweavers.com>
>
> Signed-off-by: Bruno Jesus <bjesus at codeweavers.com>
> ---
> dlls/winmm/mci.c | 3 +++
> dlls/winmm/tests/mci.c | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c
> index b8adea6..f772388 100644
> --- a/dlls/winmm/mci.c
> +++ b/dlls/winmm/mci.c
> @@ -1343,6 +1343,9 @@ DWORD WINAPI mciSendStringW(LPCWSTR lpstrCommand, LPWSTR lpstrRet,
> debugstr_w(lpstrCommand), lpstrRet, uRetLen, hwndCallback);
> if (lpstrRet && uRetLen) *lpstrRet = '\0';
>
> + if (!lpstrCommand[0])
> + return MCIERR_MISSING_COMMAND_STRING;
> +
> /* format is <command> <device> <optargs> */
> if (!(verb = HeapAlloc(GetProcessHeap(), 0, (strlenW(lpstrCommand)+1) * sizeof(WCHAR))))
> return MCIERR_OUT_OF_MEMORY;
> diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c
> index 9ff6c58..52790c8 100644
> --- a/dlls/winmm/tests/mci.c
> +++ b/dlls/winmm/tests/mci.c
> @@ -198,7 +198,7 @@ static void test_mciParser(HWND hwnd)
>
> buf[0]='z';
> err = mciSendStringA("", buf, sizeof(buf), NULL);
> - todo_wine ok(err==MCIERR_MISSING_COMMAND_STRING,"empty string: %s\n", dbg_mcierr(err));
> + ok(err==MCIERR_MISSING_COMMAND_STRING,"empty string: %s\n", dbg_mcierr(err));
> ok(!buf[0], "error buffer %s\n", buf);
>
> buf[0]='d';
> --
> 2.9.3
>
>
>
More information about the wine-patches
mailing list