diff options
| author | Paul Eggert | 2019-10-18 13:07:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-10-18 13:23:11 -0700 |
| commit | b72ff3667a137ca5d03f6a5c3cff722f004bc8ed (patch) | |
| tree | d162f5fcad5e194d40e9ebeeaef5b5d07e3b5bcf /src | |
| parent | 36c75c2a413beebc0b5163ba962cacfcea36db02 (diff) | |
| download | emacs-b72ff3667a137ca5d03f6a5c3cff722f004bc8ed.tar.gz emacs-b72ff3667a137ca5d03f6a5c3cff722f004bc8ed.zip | |
Fix integer-overflow bug in Time conversion
Problem reported by Stefan Monnier (Bug#37795).
* src/keyboard.c (make_lispy_position)
(make_scroll_bar_position, make_lispy_event):
* src/xterm.c (x_ewmh_activate_frame):
Use INT_TO_INTEGER to convert Time to a Lisp integer,
since the value might not be a fixnum.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 6 | ||||
| -rw-r--r-- | src/xterm.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index d67d18a801e..db583ec530e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5242,7 +5242,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5242 | Fcons (posn, | 5242 | Fcons (posn, |
| 5243 | Fcons (Fcons (make_fixnum (xret), | 5243 | Fcons (Fcons (make_fixnum (xret), |
| 5244 | make_fixnum (yret)), | 5244 | make_fixnum (yret)), |
| 5245 | Fcons (make_fixnum (t), | 5245 | Fcons (INT_TO_INTEGER (t), |
| 5246 | extra_info)))); | 5246 | extra_info)))); |
| 5247 | } | 5247 | } |
| 5248 | 5248 | ||
| @@ -5267,7 +5267,7 @@ static Lisp_Object | |||
| 5267 | make_scroll_bar_position (struct input_event *ev, Lisp_Object type) | 5267 | make_scroll_bar_position (struct input_event *ev, Lisp_Object type) |
| 5268 | { | 5268 | { |
| 5269 | return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y), | 5269 | return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y), |
| 5270 | make_fixnum (ev->timestamp), | 5270 | INT_TO_INTEGER (ev->timestamp), |
| 5271 | builtin_lisp_symbol (scroll_bar_parts[ev->part])); | 5271 | builtin_lisp_symbol (scroll_bar_parts[ev->part])); |
| 5272 | } | 5272 | } |
| 5273 | 5273 | ||
| @@ -5579,7 +5579,7 @@ make_lispy_event (struct input_event *event) | |||
| 5579 | position = list4 (event->frame_or_window, | 5579 | position = list4 (event->frame_or_window, |
| 5580 | Qmenu_bar, | 5580 | Qmenu_bar, |
| 5581 | Fcons (event->x, event->y), | 5581 | Fcons (event->x, event->y), |
| 5582 | make_fixnum (event->timestamp)); | 5582 | INT_TO_INTEGER (event->timestamp)); |
| 5583 | 5583 | ||
| 5584 | return list2 (item, position); | 5584 | return list2 (item, position); |
| 5585 | } | 5585 | } |
diff --git a/src/xterm.c b/src/xterm.c index 5d8b1482a6d..045589534fb 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11589,7 +11589,8 @@ x_ewmh_activate_frame (struct frame *f) | |||
| 11589 | x_send_client_event (frame, make_fixnum (0), frame, | 11589 | x_send_client_event (frame, make_fixnum (0), frame, |
| 11590 | dpyinfo->Xatom_net_active_window, | 11590 | dpyinfo->Xatom_net_active_window, |
| 11591 | make_fixnum (32), | 11591 | make_fixnum (32), |
| 11592 | list2i (1, dpyinfo->last_user_time)); | 11592 | list2 (make_fixnum (1), |
| 11593 | INT_TO_INTEGER (dpyinfo->last_user_time))); | ||
| 11593 | } | 11594 | } |
| 11594 | } | 11595 | } |
| 11595 | 11596 | ||