advpack: Fill the output buffer to workaround a bug in IE7s advpack

James Hawkins truiken at gmail.com
Tue Jan 9 22:21:17 CST 2007


Hi,

This 'fixes' several failures when IE7 is installed.  This version of
advpack actually checks the length of the output string using strlen
on the buffer itself.

Changelog:
* Fill the output buffer to workaround a bug in IE7s advpack.

 dlls/advpack/tests/advpack.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/advpack/tests/advpack.c b/dlls/advpack/tests/advpack.c
index c9a2d36..9cf1e8a 100644
--- a/dlls/advpack/tests/advpack.c
+++ b/dlls/advpack/tests/advpack.c
@@ -329,6 +329,8 @@ static void translateinfstringex_test(void)
     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
 
     /* try an empty filename */
+    memset(buffer, 'a', 25);
+    buffer[24] = '\0';
     size = MAX_PATH;
     hr = pTranslateInfStringEx(hinf, "", "Options.NTx86", "InstallDir",
                               buffer, size, &size, NULL);
@@ -360,6 +362,8 @@ static void translateinfstringex_test(void)
     ok(hr == SPAPI_E_LINE_NOT_FOUND, "Expected SPAPI_E_LINE_NOT_FOUND, got %08x\n", hr);
 
     /* successfully translate the string */
+    memset(buffer, 'a', 25);
+    buffer[24] = '\0';
     size = MAX_PATH;
     hr = pTranslateInfStringEx(hinf, "c:\\test.inf", "Options.NTx86", "InstallDir",
                               buffer, size, &size, NULL);
@@ -383,6 +387,8 @@ static void translateinfstringex_test(void)
     ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
 
     /* translate the string with the install section specified */
+    memset(buffer, 'a', PROG_FILES_LEN);
+    buffer[PROG_FILES_LEN - 1] = '\0';
     size = MAX_PATH;
     hr = pTranslateInfStringEx(hinf, "c:\\test.inf", "Options.NTx86", "InstallDir",
                               buffer, size, &size, NULL);
-- 
1.4.4.2


More information about the wine-patches mailing list