diff options
Diffstat (limited to 'generic/tclBinary.c')
| -rw-r--r-- | generic/tclBinary.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 96adff0..4e17979 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -3058,6 +3058,11 @@ BinaryDecode64( } else if (i > 1) { c = '='; } else { + if (strict && i <= 1) { + /* single resp. unfulfilled char (each 4th next single char) + * is rather bad64 error case in strict mode */ + goto bad64; + } cut += 3; break; } @@ -3088,9 +3093,11 @@ BinaryDecode64( value = (value << 6) | 0x3e; } else if (c == '/') { value = (value << 6) | 0x3f; - } else if (c == '=') { + } else if (c == '=' && ( + !strict || i > 1) /* "=" and "a=" is rather bad64 error case in strict mode */ + ) { value <<= 6; - cut++; + if (i) cut++; } else if (strict || !TclIsSpaceProc(c)) { goto bad64; } else { |
