From: Glenn Burkhardt <[email protected]>

Originally sent to xorg@ back in July 2007.
http://lists.x.org/archives/xorg/2007-July/025997.html

---
Please don't ignore it this time.

 src/Box.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Box.c b/src/Box.c
index 7aa14a5..5336908 100644
--- a/src/Box.c
+++ b/src/Box.c
@@ -392,9 +392,10 @@ XawBoxQueryGeometry(Widget widget, XtWidgetGeometry 
*constraint,
        if (preferred_width <= constraint->width) {
            width = preferred_width;
            do { /* find some width big enough to stay within this height */
-               width <<= 1;
-               if (width > constraint->width)
+               if (width > constraint->width >> 1) /* avoid short int overflow 
*/
                    width = constraint->width;
+               else
+                   width <<= 1;
                DoLayout(w, width, 0, &preferred_width, &preferred_height, 
False);
            } while (preferred_height > constraint->height
                     && width < constraint->width);
-- 
1.7.2.2

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to