diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-24 14:05:58 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-24 14:05:58 (GMT) |
commit | ddf4a5f1583b7a5c030020dcf4a1e712b5d465f2 (patch) | |
tree | e6c57b9ad18789b4ed5787e83087043a52ccb47d /generic/tclLink.c | |
parent | 2a569c94ef1b7bac9236da247c9f02f96992eec3 (diff) | |
download | tcl-ddf4a5f1583b7a5c030020dcf4a1e712b5d465f2.zip tcl-ddf4a5f1583b7a5c030020dcf4a1e712b5d465f2.tar.gz tcl-ddf4a5f1583b7a5c030020dcf4a1e712b5d465f2.tar.bz2 |
Use Tcl_GetByteArrayFromObj(... in stead of Tcl_GetBytesFromObj(NULL,.... Add some more error-checking for invalid byte-arrays
Diffstat (limited to 'generic/tclLink.c')
-rw-r--r-- | generic/tclLink.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclLink.c b/generic/tclLink.c index a0212ee..0088950 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -880,7 +880,9 @@ LinkTraceProc( case TCL_LINK_BINARY: value = (char *) Tcl_GetByteArrayFromObj(valueObj, &valueLength); - if (valueLength != linkPtr->bytes) { + if (value == NULL) { + return (char *) "invalid binary value"; + } else if (valueLength != linkPtr->bytes) { return (char *) "wrong size of binary value"; } if (linkPtr->flags & LINK_ALLOC_LAST) { |