msxml3: Prevent a crash at second call to vsnprintf

André Hentschel nerv at dawncrow.de
Thu Mar 17 18:00:09 CDT 2011


i did test that now for a while and if the first time the buffer isn't enough and len gets incremented (no matter how much) then the next call to vnsprintf crashes.
that seems to happen only with 64 bits and i would blame Ubuntu for it :)
see http://test.winehq.org/data/12b24af8d7bbb515c4cc678eef45c396487816a4/wine_ah-ub1004-64-nv-64/msxml3:domdoc.html

so bumping the buffer length to 64 is enough to not trigger that case with our testsuite
---
 dlls/msxml3/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/msxml3/main.c b/dlls/msxml3/main.c
index 01eabab..d3fda99 100644
--- a/dlls/msxml3/main.c
+++ b/dlls/msxml3/main.c
@@ -63,7 +63,7 @@ HINSTANCE MSXML_hInstance = NULL;
 void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap)
 {
     char* buf = NULL;
-    int len = 32, needed;
+    int len = 64, needed;
     enum __wine_debug_class dbcl = __WINE_DBCL_ERR;
     switch (lvl)
     {
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list