summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-05-10 18:54:10 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-05-10 18:54:10 (GMT)
commit5d9a90aa1eb03973daff1aee8fa4eadd7a37b45b (patch)
treee076b1457473c433aadfe4debc4f612d1c32cbfa
parent76e3b5eed61a674bce7f9c1e18380842dcff3fbf (diff)
downloadtcl-5d9a90aa1eb03973daff1aee8fa4eadd7a37b45b.zip
tcl-5d9a90aa1eb03973daff1aee8fa4eadd7a37b45b.tar.gz
tcl-5d9a90aa1eb03973daff1aee8fa4eadd7a37b45b.tar.bz2
Fixed uninitialized memory read in tclBinary.c when passing a NaN to 'd','q','Q' formats
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclBinary.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f13031..ca964be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2005-05-10 Kevin Kenny <kennykb@acm.org>
+ * tclBinary.c (FormatNumber): Fixed a bug where NaN's
+ resulted in reads of uninitialized memory when using 'd',
+ 'q', or 'Q' format.
+
+2005-05-10 Kevin Kenny <kennykb@acm.org>
+
Merged all changes on kennykb-numerics-branch back into the
HEAD. TIP's 132 and 232 are now Final.
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 706d1f0..fa75841 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBinary.c,v 1.22 2005/05/10 18:34:07 kennykb Exp $
+ * RCS: @(#) $Id: tclBinary.c,v 1.23 2005/05/10 18:54:31 kennykb Exp $
*/
#include "tclInt.h"
@@ -1632,6 +1632,7 @@ FormatNumber(interp, type, src, cursorPtr)
if ( src->typePtr != &tclDoubleType ) {
return TCL_ERROR;
}
+ dvalue = src->internalRep.doubleValue;
}
/*