summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
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--;