diff options
| author | Noah Friedman | 2020-10-29 14:55:37 -0700 |
|---|---|---|
| committer | Noah Friedman | 2020-10-29 14:55:37 -0700 |
| commit | da6234e2dfd8c345bad1ff3075033b282b64f958 (patch) | |
| tree | 28b059b7c089be59e626f1ca3854566fbe8c1cea /src | |
| parent | 2d15296db112740bcb6e7fa5808b57f12a99e49e (diff) | |
| download | emacs-da6234e2dfd8c345bad1ff3075033b282b64f958.tar.gz emacs-da6234e2dfd8c345bad1ff3075033b282b64f958.zip | |
Make sure pixel sizes are zero when setting window size for ptys.
* sysdep.c (set_window_size): Initialize data to zero to avoid
passing any garbage from the stack to ioctl.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index cb2f7f2f23c..addaf4dc28a 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1447,6 +1447,7 @@ set_window_size (int fd, int height, int width) | |||
| 1447 | 1447 | ||
| 1448 | /* BSD-style. */ | 1448 | /* BSD-style. */ |
| 1449 | struct winsize size; | 1449 | struct winsize size; |
| 1450 | memset (&size, 0, sizeof (size)); | ||
| 1450 | size.ws_row = height; | 1451 | size.ws_row = height; |
| 1451 | size.ws_col = width; | 1452 | size.ws_col = width; |
| 1452 | 1453 | ||
| @@ -1457,6 +1458,7 @@ set_window_size (int fd, int height, int width) | |||
| 1457 | 1458 | ||
| 1458 | /* SunOS - style. */ | 1459 | /* SunOS - style. */ |
| 1459 | struct ttysize size; | 1460 | struct ttysize size; |
| 1461 | memset (&size, 0, sizeof (size)); | ||
| 1460 | size.ts_lines = height; | 1462 | size.ts_lines = height; |
| 1461 | size.ts_cols = width; | 1463 | size.ts_cols = width; |
| 1462 | 1464 | ||