diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-04 14:52:59 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-04 14:52:59 -0700 |
commit | 86633eab8a77697f6e15aae568868781a5a1023f (patch) | |
tree | 22039ff17f96363d7115a8e02c0884010ba75744 /src/gtkutil.c | |
parent | 53e9fe90811730f68c4ea246cd8dee8aa22486de (diff) | |
parent | 6511acf2570df26e93e15283d593b8e81d217a78 (diff) | |
download | emacs-86633eab8a77697f6e15aae568868781a5a1023f.tar.gz emacs-86633eab8a77697f6e15aae568868781a5a1023f.tar.bz2 emacs-86633eab8a77697f6e15aae568868781a5a1023f.zip |
sprintf-related integer and memory overflow issues
Fixes: debbugs:9397 debbugs:9412
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index c39119c8151..c154797735e 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #ifdef USE_GTK +#include <float.h> #include <signal.h> #include <stdio.h> #include <setjmp.h> @@ -567,7 +568,7 @@ xg_check_special_colors (struct frame *f, GtkStyleContext *gsty = gtk_widget_get_style_context (FRAME_GTK_OUTER_WIDGET (f)); GdkRGBA col; - char buf[64]; + char buf[sizeof "rgbi://" + 3 * (DBL_MAX_10_EXP + sizeof "-1.000000" - 1)]; int state = GTK_STATE_FLAG_SELECTED|GTK_STATE_FLAG_FOCUSED; if (get_fg) gtk_style_context_get_color (gsty, state, &col); @@ -797,7 +798,7 @@ xg_set_geometry (FRAME_PTR f) int xneg = f->size_hint_flags & XNegative; int top = f->top_pos; int yneg = f->size_hint_flags & YNegative; - char geom_str[32]; + char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; if (xneg) left = -left; |