From: Paul Eggert Date: Sun, 17 Jun 2012 07:39:50 +0000 (-0700) Subject: * xterm.c (x_draw_underwave): Check for integer overflow. X-Git-Tag: emacs-24.2.90~1199^2~450 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9a900ca947a69c01411ff467cb49cb09fb40b75a;p=emacs.git * xterm.c (x_draw_underwave): Check for integer overflow. This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64. --- diff --git a/src/ChangeLog b/src/ChangeLog index 8baeeadc2d5..662aa5232ab 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-06-17 Paul Eggert + + * xterm.c (x_draw_underwave): Check for integer overflow. + This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64. + 2012-06-17 Jan Djärv * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't diff --git a/src/xterm.c b/src/xterm.c index 914d195778f..fec661625f2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2710,6 +2710,9 @@ x_draw_underwave (struct glyph_string *s) else y2 += dy; + if (INT_MAX - dx < xmax) + abort (); + while (x1 <= xmax) { XDrawLine (s->display, s->window, s->gc, x1, y1, x2, y2);