List:Commits« Previous MessageNext Message »
From:vvaintroub Date:May 14 2008 2:00pm
Subject:bk commit into 6.0 tree (vvaintroub:1.2652)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of vvaintroub.  When vvaintroub does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-05-14 14:00:18+02:00, vvaintroub@wva. +1 -0
  Fix crash in DBUG_PRINT when it is called with %f.

  strings/my_vsnprintf.c@stripped, 2008-05-14 14:00:16+02:00, vvaintroub@wva. +4 -4
    Problem :my_vsnprintf runs into assertion when called with %f.
    , so that DBUG_PRINT with %f crashes the server.
    
    Reason:  
    Missing precision format modifier (%f without any length 
    params)was incorrectly detected by  my_vsnprintf() - 
    the function handled this case as if SIZE_T_MAX  precision was
    requested. Though precision was truncated to 
    NOT_FIXED_DEC, but unfortunately it is 1 more than my_fcvt() 
    can handle.
    
    Fix: correct detection of  %f with default precision.
    Pass at most NOT_FIXED_DEC-1 to my_fcvt.
    

diff -Nrup a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
--- a/strings/my_vsnprintf.c	2008-03-03 11:12:45 +01:00
+++ b/strings/my_vsnprintf.c	2008-05-14 14:00:16 +02:00
@@ -132,10 +132,10 @@ size_t my_vsnprintf(char *to, size_t n, 
     else if (*fmt == 'f' || *fmt == 'g')
     {
       double d= va_arg(ap, double);
-      if (width == 0)
-        width= FLT_DIG;
-      else if (width > NOT_FIXED_DEC)
-        width= NOT_FIXED_DEC; /* max.precision for my_fcvt() */
+      if (width == ~0)
+        width= FLT_DIG; /* width not set, use default */
+      else if (width >= NOT_FIXED_DEC)
+        width= NOT_FIXED_DEC - 1; /* max.precision for my_fcvt() */
       width= min(width, (size_t)(end-to) - 1);
 
       if (*fmt == 'f')
Thread
bk commit into 6.0 tree (vvaintroub:1.2652)vvaintroub14 May