diff options
| author | Eli Zaretskii | 2024-03-04 14:59:27 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2024-03-04 14:59:27 +0200 |
| commit | 0df3dc3d46fe7848aabb3ca5ff7085ca59799f43 (patch) | |
| tree | 1a893927f1f29d2cb6d86b665d0e0f8703c850c3 /src/buffer.c | |
| parent | 912e37b811107768e0cb3bc95184177f817dbdb2 (diff) | |
| download | emacs-0df3dc3d46fe7848aabb3ca5ff7085ca59799f43.tar.gz emacs-0df3dc3d46fe7848aabb3ca5ff7085ca59799f43.zip | |
Avoid crashes due to base-less indirect buffer
* src/buffer.c (Fkill_buffer): Prevent killing a buffer if its
indirect buffer refuses to be killed. (Bug#69529)
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index 126f3eb055a..9f55a8813fa 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1971,8 +1971,16 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1971 | Lisp_Object tail, other; | 1971 | Lisp_Object tail, other; |
| 1972 | 1972 | ||
| 1973 | FOR_EACH_LIVE_BUFFER (tail, other) | 1973 | FOR_EACH_LIVE_BUFFER (tail, other) |
| 1974 | if (XBUFFER (other)->base_buffer == b) | 1974 | { |
| 1975 | Fkill_buffer (other); | 1975 | struct buffer *obuf = XBUFFER (other); |
| 1976 | if (obuf->base_buffer == b) | ||
| 1977 | { | ||
| 1978 | Fkill_buffer (other); | ||
| 1979 | if (BUFFER_LIVE_P (obuf)) | ||
| 1980 | error ("Unable to kill buffer whose indirect buffer `%s' cannot be killed", | ||
| 1981 | SDATA (BVAR (obuf, name))); | ||
| 1982 | } | ||
| 1983 | } | ||
| 1976 | 1984 | ||
| 1977 | /* Exit if we now have killed the base buffer (Bug#11665). */ | 1985 | /* Exit if we now have killed the base buffer (Bug#11665). */ |
| 1978 | if (!BUFFER_LIVE_P (b)) | 1986 | if (!BUFFER_LIVE_P (b)) |