Jon Griffiths : oleaut32: Don' t read past the digits array in VARIANT_FormatNumber.

Alexandre Julliard julliard at winehq.org
Mon Jul 7 09:19:28 CDT 2008


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

Author: Jon Griffiths <jon_p_griffiths at yahoo.com>
Date:   Sun Jul  6 10:17:16 2008 -0700

oleaut32: Don't read past the digits array in VARIANT_FormatNumber.

---

 dlls/oleaut32/varformat.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c
index b2175d3..83f075f 100644
--- a/dlls/oleaut32/varformat.c
+++ b/dlls/oleaut32/varformat.c
@@ -1463,7 +1463,8 @@ VARIANT_FormatNumber_Bool:
           while (count-- > 0)
             *pBuff++ = '0';
         }
-        if (*pToken == FMT_NUM_COPY_ZERO || have_int > 1 || *prgbDig > 0)
+        if (*pToken == FMT_NUM_COPY_ZERO || have_int > 1 ||
+            (have_int > 0 && *prgbDig > 0))
         {
           dwState |= NUM_WRITE_ON;
           count = min(count_max, have_int);




More information about the wine-cvs mailing list