Piotr Caban : msvcp110: Fix sprintf argument size in num_put:: do_put_double.

Alexandre Julliard julliard at winehq.org
Mon Jan 27 13:32:52 CST 2014


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Jan 21 15:18:34 2014 +0100

msvcp110: Fix sprintf argument size in num_put::do_put_double.

---

 dlls/msvcp90/locale.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index 2cdd002..606d6ca 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -7350,9 +7350,12 @@ ostreambuf_iterator_char* __thiscall num_put_char_put_ulong(const num_put *this,
     return call_num_put_char_do_put_ulong(this, ret, dest, base, fill, v);
 }
 
-static inline streamsize get_precision(const ios_base *base)
+static inline unsigned get_precision(const ios_base *base)
 {
-    return base->prec <= 0 && !(base->fmtfl & FMTFLAG_fixed) ? 6 : base->prec;
+    streamsize ret = base->prec <= 0 && !(base->fmtfl & FMTFLAG_fixed) ? 6 : base->prec;
+    if(ret > UINT_MAX)
+        ret = UINT_MAX;
+    return ret;
 }
 
 /* ?do_put@?$num_put at DV?$ostreambuf_iterator at DU?$char_traits at D@std@@@std@@@std@@MBE?AV?$ostreambuf_iterator at DU?$char_traits at D@std@@@2 at V32@AAVios_base at 2@DN at Z */
@@ -7385,7 +7388,7 @@ ostreambuf_iterator_char* __thiscall num_put_char_do_put_double(const num_put *t
     char *tmp;
     char fmt[8]; /* strlen("%+#.*lg")+1 */
     int size;
-    streamsize prec;
+    unsigned prec;
 
     TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
 
@@ -8304,7 +8307,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_wchar_do_put_double(const num_put
     char *tmp;
     char fmt[8]; /* strlen("%+#.*lg")+1 */
     int size;
-    streamsize prec;
+    unsigned prec;
 
     TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
 
@@ -8339,7 +8342,7 @@ ostreambuf_iterator_wchar* __thiscall num_put_short_do_put_double(const num_put
     char *tmp;
     char fmt[8]; /* strlen("%+#.*lg")+1 */
     int size;
-    streamsize prec;
+    unsigned prec;
 
     TRACE("(%p %p %p %d %lf)\n", this, ret, base, fill, v);
 




More information about the wine-cvs mailing list