From 1c0122d14e8dd3e4d54678b9538aba1aadfaba3e Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Fri, 29 Feb 2008 11:12:32 +0000 Subject: [PATCH] quartz: Don't assume that strlenW of a constant string can be determined at compile time. Use sizeof instead to calculate the size of wszKeyName in FilterMapper2_CreateCategory. --- dlls/quartz/filtermapper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 8b7cf7d393a..eeba0b13b33 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -41,6 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); +#define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0])) + /* Unexposed IAMFilterData interface */ typedef struct IAMFilterData IAMFilterData; @@ -311,7 +313,7 @@ static HRESULT WINAPI FilterMapper2_CreateCategory( { LPWSTR wClsidAMCat = NULL; LPWSTR wClsidCategory = NULL; - WCHAR wszKeyName[strlenW(wszClsidSlash) + strlenW(wszSlashInstance) + (CHARS_IN_GUID-1) * 2 + 1]; + WCHAR wszKeyName[ARRAYSIZE(wszClsidSlash)-1 + ARRAYSIZE(wszSlashInstance)-1 + (CHARS_IN_GUID-1) * 2 + 1]; HKEY hKey = NULL; LONG lRet; HRESULT hr;