Be afraid, be very afraid....
Are we going to have to audit the whole code for stuff like this?
:-(
I think that whole code should be audited for race conditions....
And its clients..
Index: process.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/process.c,v
retrieving revision 1.39.2.12
diff -u -u -r1.39.2.12 process.c
--- process.c 2000/02/21 23:06:59 1.39.2.12
+++ process.c 2000/03/18 01:19:03
@@ -921,12 +921,16 @@
buffer_insert_raw_string (buf, chars, nbytes);
#endif
- Fset_marker (p->mark, make_int (BUF_PT (buf)), p->buffer);
+ /* buffer_insert_raw_string_1 can call lisp code! */
- MARK_MODELINE_CHANGED;
+ if (BUFFER_LIVE_P(buf))
+ {
+ Fset_marker (p->mark, make_int (BUF_PT (buf)), p->buffer);
+
+ MARK_MODELINE_CHANGED;
- /* If the restriction isn't what it should be, set it. */
- if (old_begv != BUF_BEGV (buf) || old_zv != BUF_ZV (buf))
+ /* If the restriction isn't what it should be, set it. */
+ if (old_begv != BUF_BEGV (buf) || old_zv != BUF_ZV (buf))
{
Fwiden(p->buffer);
old_begv = bufpos_clip_to_bounds (BUF_BEG (buf),
@@ -939,14 +943,15 @@
p->buffer);
}
- /* Handling the process output should not deactivate the mark. */
- zmacs_region_stays = old_zmacs_region_stays;
- buf->read_only = old_read_only;
- old_point = bufpos_clip_to_bounds (BUF_BEGV (buf),
- old_point,
- BUF_ZV (buf));
- BUF_SET_PT (buf, old_point);
-
+ /* Handling the process output should not deactivate the mark. */
+ zmacs_region_stays = old_zmacs_region_stays;
+ buf->read_only = old_read_only;
+ old_point = bufpos_clip_to_bounds (BUF_BEGV (buf),
+ old_point,
+ BUF_ZV (buf));
+ BUF_SET_PT (buf, old_point);
+ }
+
UNGCPRO;
}
return nchars;