summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
authorferrieux <ferrieux@users.sourceforge.net>2008-12-15 17:11:33 (GMT)
committerferrieux <ferrieux@users.sourceforge.net>2008-12-15 17:11:33 (GMT)
commitdde8810e8f2c4a89922d0d36deea83b18e1f93dc (patch)
tree0351578b5f8df10219d98254002cbf6fe3648304 /generic/tclBinary.c
parentf846544ae625a6ea36e4a75e8f5f6caf47d6242c (diff)
downloadtcl-dde8810e8f2c4a89922d0d36deea83b18e1f93dc.zip
tcl-dde8810e8f2c4a89922d0d36deea83b18e1f93dc.tar.gz
tcl-dde8810e8f2c4a89922d0d36deea83b18e1f93dc.tar.bz2
Fix [Bug 2380293]. Redefine non-strict decoding to ignore only whitespace.
Diffstat (limited to 'generic/tclBinary.c')
-rw-r--r--generic/tclBinary.c9
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--;