summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkd <markd@pkgsrc.org>2006-03-13 00:16:23 +0000
committermarkd <markd@pkgsrc.org>2006-03-13 00:16:23 +0000
commit29dd14401e395de979f08e567e3dfc9e04f05221 (patch)
tree003d490b35527d80afb671b69bb1c1d211e79222
parent83f79ba5fe63e899d9a29b26653ac11109e80ddb (diff)
downloadpkgsrc-29dd14401e395de979f08e567e3dfc9e04f05221.tar.gz
The x11/Xaw3d library has an integer overflow error in the computation
of the geometry for a Box Layout (file Box.c). There, the box tries to extend its width until its height fits within the constraint height (influenced by the window manager). Unfortunately, widths are 16bit unsigned and in the error case (occuring under KDE), the constraint width is 65535, i.e. maximal. The code loops until either the computed height is smaller than the constraint height or the width exceeds the constraint width. In each loop iteration, the width of the box layout is doubled. This loop does not terminate, if one chooses unfortunate initial width, as the width wraps around if it overflows 16 bits and if the maximal constraint width is SHORT_INT_MAX. Patch tries to capture the overflow before it wraps around the `width' variable, setting the width to the maximal one. From Stephan Thesing in PR pkg/32445. Bump PKGREVISION.
-rw-r--r--x11/Xaw3d/Makefile4
-rw-r--r--x11/Xaw3d/distinfo3
-rw-r--r--x11/Xaw3d/patches/patch-ac18
3 files changed, 22 insertions, 3 deletions
diff --git a/x11/Xaw3d/Makefile b/x11/Xaw3d/Makefile
index cf0d9c6e1a4..103344a697a 100644
--- a/x11/Xaw3d/Makefile
+++ b/x11/Xaw3d/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.47 2006/03/04 21:31:07 jlam Exp $
+# $NetBSD: Makefile,v 1.48 2006/03/13 00:16:23 markd Exp $
#
DISTNAME= Xaw3d-1.5E
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= x11
MASTER_SITES= ftp://ftp.visi.com/users/hawkeyd/X/
diff --git a/x11/Xaw3d/distinfo b/x11/Xaw3d/distinfo
index 3be9e9ea9d6..11ab36fe725 100644
--- a/x11/Xaw3d/distinfo
+++ b/x11/Xaw3d/distinfo
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.8 2005/04/14 01:41:27 dmcmahill Exp $
+$NetBSD: distinfo,v 1.9 2006/03/13 00:16:23 markd Exp $
SHA1 (Xaw3d-1.5E.tar.gz) = efc5b923feda52866c859c59a5b553cb675a69d1
RMD160 (Xaw3d-1.5E.tar.gz) = 086cbabaa45ce5c110815aea24eebcbb54613118
Size (Xaw3d-1.5E.tar.gz) = 309264 bytes
SHA1 (patch-aa) = 7729cfe83671f482670350ead9ccf1bfe3e932e3
SHA1 (patch-ab) = 9bbe44041708b2d01b728638ac07e32addc01cff
+SHA1 (patch-ac) = cce339b75bdfe407608f004eaf1f22fca26ecd5e
diff --git a/x11/Xaw3d/patches/patch-ac b/x11/Xaw3d/patches/patch-ac
new file mode 100644
index 00000000000..0525528ea4b
--- /dev/null
+++ b/x11/Xaw3d/patches/patch-ac
@@ -0,0 +1,18 @@
+$NetBSD: patch-ac,v 1.1 2006/03/13 00:16:23 markd Exp $
+
+--- Box.c.orig 1996-10-16 03:41:18.000000000 +1300
++++ Box.c
+@@ -352,8 +352,12 @@ static XtGeometryResult PreferredSize(wi
+ }
+ else {
+ width = preferred_width;
++ if (0==width) width=1;
+ do { /* find some width big enough to stay within this height */
+- width *= 2;
++ if (width>=32768) /* overflow */
++ width=constraint->width;
++ else
++ width *= 2;
+ if (width > constraint->width) width = constraint->width;
+ DoLayout(w, width, 0, &preferred_width, &preferred_height, FALSE);
+ } while (preferred_height > constraint->height &&