summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortreectrl <treectrl>2004-07-26 17:25:18 (GMT)
committertreectrl <treectrl>2004-07-26 17:25:18 (GMT)
commit042049fbfffec928d18afe26254ce222b0d176ad (patch)
tree1d3c31e81802087c2fd3cab4d2cfddaa1bc6037d
parent3dac1cb0db538a2525b649ab84a6fc3f375ef704 (diff)
downloadtktreectrl-042049fbfffec928d18afe26254ce222b0d176ad.zip
tktreectrl-042049fbfffec928d18afe26254ce222b0d176ad.tar.gz
tktreectrl-042049fbfffec928d18afe26254ce222b0d176ad.tar.bz2
Fix panic() attack in yview/xview when visible height/width <= 0.
-rw-r--r--generic/tkTreeDisplay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkTreeDisplay.c b/generic/tkTreeDisplay.c
index b641ce4..f672ace 100644
--- a/generic/tkTreeDisplay.c
+++ b/generic/tkTreeDisplay.c
@@ -1044,7 +1044,7 @@ int B_XviewCmd(TreeCtrl *tree, int objc, Tcl_Obj *CONST objv[])
int visWidth = Tk_Width(tree->tkwin) - tree->inset * 2;
int totWidth = Tree_TotalWidth(tree);
- if (totWidth <= visWidth)
+ if ((totWidth == 0) || (visWidth <= 0) || (totWidth <= visWidth))
return TCL_OK;
if (visWidth > 1)
@@ -1131,7 +1131,7 @@ int B_YviewCmd(TreeCtrl *tree, int objc, Tcl_Obj *CONST objv[])
int visHeight = Tk_Height(tree->tkwin) - topInset - tree->inset;
int totHeight = Tree_TotalHeight(tree);
- if (totHeight <= visHeight)
+ if ((totHeight == 0) || (visHeight <= 0) || (totHeight <= visHeight))
return TCL_OK;
if (visHeight > 1)