projects
/
kitgen
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d622b1
)
Avoid crash when calling sinflate with incorrect args
author
Pat Thoyts
<patthoyts@users.sourceforge.net>
Mon, 19 Nov 2007 23:17:01 +0000
(23:17 +0000)
committer
Pat Thoyts
<patthoyts@users.sourceforge.net>
Mon, 19 Nov 2007 23:17:01 +0000
(23:17 +0000)
git-svn-id: svn://svn.equi4.com/kitgen/trunk@1845
9e558909
-932a-0410-a563-
af77432da1eb
zlib.c
patch
|
blob
|
history
diff --git
a/zlib.c
b/zlib.c
index afbadbb57cbdd91b4d02d571f662d948c93233bf..12711dfbe96e5508cb796795925d627c2c04678c 100644
(file)
--- a/
zlib.c
+++ b/
zlib.c
@@
-21,7
+21,11
@@
zstreamincmd(ClientData cd, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[])
Tcl_Obj *obj;
static CONST84 char* cmds[] = { "fill", "drain", NULL, };
-
+
+ if (objc < 2 || objc > 3) {
+ Tcl_WrongNumArgs(ip, 2, objv, "fill|drain data");
+ return TCL_ERROR;
+ }
if (Tcl_GetIndexFromObj(ip, objv[1], cmds, "option", 0, &index) != TCL_OK)
return TCL_ERROR;
@@
-143,6
+147,10
@@
ZlibCmd(ClientData dummy, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[])
{
if (objc < 4)
flag = 16 * 1024;
+ if (flag < 1) {
+ Tcl_SetResult(ip, "invalid buffer size", TCL_STATIC);
+ return TCL_ERROR;
+ }
for (;;) {
stream.zalloc = 0;