diff options
| author | ferrieux@users.sourceforge.net <ferrieux> | 2008-12-15 17:11:33 (GMT) |
|---|---|---|
| committer | ferrieux@users.sourceforge.net <ferrieux> | 2008-12-15 17:11:33 (GMT) |
| commit | e2abdc38d6db95694e9fb5930a3dad0e317c1257 (patch) | |
| tree | 0351578b5f8df10219d98254002cbf6fe3648304 /generic/tclBinary.c | |
| parent | 83a380aba37f8f3edea1feae5f2d9f2fc4af7036 (diff) | |
| download | tcl-e2abdc38d6db95694e9fb5930a3dad0e317c1257.zip tcl-e2abdc38d6db95694e9fb5930a3dad0e317c1257.tar.gz tcl-e2abdc38d6db95694e9fb5930a3dad0e317c1257.tar.bz2 | |
Fix [Bug 2380293]. Redefine non-strict decoding to ignore only whitespace.
Diffstat (limited to 'generic/tclBinary.c')
| -rw-r--r-- | generic/tclBinary.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 18c12fa..5e86653 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.51 2008/11/16 17:17:44 dkf Exp $ + * RCS: @(#) $Id: tclBinary.c,v 1.52 2008/12/15 17:11:34 ferrieux Exp $ */ #include "tclInt.h" @@ -2288,7 +2288,7 @@ BinaryDecodeHex( c = *data++; if (!isxdigit((int) c)) { - if (strict) { + if (strict || !isspace(c)) { goto badChar; } i--; @@ -2499,7 +2499,7 @@ BinaryDecodeUu( if (data < dataend) { d[i] = c = *data++; if (c < 33 || c > 96) { - if (strict) { + if (strict || !isspace(c)) { goto badUu; } i--; @@ -2509,6 +2509,7 @@ BinaryDecodeUu( ++cut; } } + if (cut>3) cut=3; *cursor++ = (((d[0] - 0x20) & 0x3f) << 2) | (((d[1] - 0x20) & 0x3f) >> 4); *cursor++ = (((d[1] - 0x20) & 0x3f) << 4) @@ -2606,7 +2607,7 @@ BinaryDecode64( ++cut; } } else { - if (strict) { + if (strict || !isspace(c)) { goto bad64; } i--; |
