diff options
| author | Paul Eggert | 2011-08-29 11:54:11 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-08-29 11:54:11 -0700 |
| commit | 84722b3d573a4ad663f84ed44e212743970a0daf (patch) | |
| tree | 670467e70765cb5dead126059f8478d1ccd81f7b /src | |
| parent | 8a4014344e961833b940a36887bdeee4935f88bd (diff) | |
| download | emacs-84722b3d573a4ad663f84ed44e212743970a0daf.tar.gz emacs-84722b3d573a4ad663f84ed44e212743970a0daf.zip | |
* gtkutil.c (xg_check_special_colors, xg_set_geometry):
Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/gtkutil.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 91bcaebb7bb..adf9bb244b8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -62,6 +62,9 @@ | |||
| 62 | use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does | 62 | use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does |
| 63 | not fit in int. | 63 | not fit in int. |
| 64 | 64 | ||
| 65 | * gtkutil.c (xg_check_special_colors, xg_set_geometry): | ||
| 66 | Make sprintf buffers a bit bigger, to avoid potential buffer overrun. | ||
| 67 | |||
| 65 | 2011-08-26 Paul Eggert <eggert@cs.ucla.edu> | 68 | 2011-08-26 Paul Eggert <eggert@cs.ucla.edu> |
| 66 | 69 | ||
| 67 | Integer and memory overflow issues (Bug#9196). | 70 | Integer and memory overflow issues (Bug#9196). |
diff --git a/src/gtkutil.c b/src/gtkutil.c index c39119c8151..5f23d597329 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -567,7 +567,7 @@ xg_check_special_colors (struct frame *f, | |||
| 567 | GtkStyleContext *gsty | 567 | GtkStyleContext *gsty |
| 568 | = gtk_widget_get_style_context (FRAME_GTK_OUTER_WIDGET (f)); | 568 | = gtk_widget_get_style_context (FRAME_GTK_OUTER_WIDGET (f)); |
| 569 | GdkRGBA col; | 569 | GdkRGBA col; |
| 570 | char buf[64]; | 570 | char buf[sizeof "rgbi://" + 3 * (DBL_MAX_10_EXP + sizeof "-1.000000" - 1)]; |
| 571 | int state = GTK_STATE_FLAG_SELECTED|GTK_STATE_FLAG_FOCUSED; | 571 | int state = GTK_STATE_FLAG_SELECTED|GTK_STATE_FLAG_FOCUSED; |
| 572 | if (get_fg) | 572 | if (get_fg) |
| 573 | gtk_style_context_get_color (gsty, state, &col); | 573 | gtk_style_context_get_color (gsty, state, &col); |
| @@ -797,7 +797,7 @@ xg_set_geometry (FRAME_PTR f) | |||
| 797 | int xneg = f->size_hint_flags & XNegative; | 797 | int xneg = f->size_hint_flags & XNegative; |
| 798 | int top = f->top_pos; | 798 | int top = f->top_pos; |
| 799 | int yneg = f->size_hint_flags & YNegative; | 799 | int yneg = f->size_hint_flags & YNegative; |
| 800 | char geom_str[32]; | 800 | char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; |
| 801 | 801 | ||
| 802 | if (xneg) | 802 | if (xneg) |
| 803 | left = -left; | 803 | left = -left; |