diff options
| author | Andreas Schwab | 2009-06-28 20:12:20 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2009-06-28 20:12:20 +0000 |
| commit | b96075879aaebbdf674c39b8d886c2fee2c9215e (patch) | |
| tree | ad44a13776193b433c9a787c2dbdd17aec6debd1 | |
| parent | 485422be112eba944a27ecea02c2e5d103ad5175 (diff) | |
| download | emacs-b96075879aaebbdf674c39b8d886c2fee2c9215e.tar.gz emacs-b96075879aaebbdf674c39b8d886c2fee2c9215e.zip | |
(send_process): Keep decoded string in a local
variable and protect it from GC. (Bug#3521)
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/process.c | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index af619a9a26a..8bee945b136 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-06-28 Andreas Schwab <schwab@linux-m68k.org> | ||
| 2 | |||
| 3 | * process.c (send_process): Keep decoded string in a local | ||
| 4 | variable and protect it from GC. (Bug#3521) | ||
| 5 | |||
| 1 | 2009-06-28 Eli Zaretskii <eliz@gnu.org> | 6 | 2009-06-28 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * term.c (create_tty_output) [MSDOS]: #ifdef away. | 8 | * term.c (create_tty_output) [MSDOS]: #ifdef away. |
diff --git a/src/process.c b/src/process.c index 2fdb2c2cbb0..38980d28383 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5550,10 +5550,11 @@ send_process (proc, buf, len, object) | |||
| 5550 | struct Lisp_Process *p = XPROCESS (proc); | 5550 | struct Lisp_Process *p = XPROCESS (proc); |
| 5551 | int rv; | 5551 | int rv; |
| 5552 | struct coding_system *coding; | 5552 | struct coding_system *coding; |
| 5553 | struct gcpro gcpro1; | 5553 | struct gcpro gcpro1, gcpro2; |
| 5554 | SIGTYPE (*volatile old_sigpipe) (); | 5554 | SIGTYPE (*volatile old_sigpipe) (); |
| 5555 | Lisp_Object dst_object = Qnil; | ||
| 5555 | 5556 | ||
| 5556 | GCPRO1 (object); | 5557 | GCPRO2 (object, dst_object); |
| 5557 | 5558 | ||
| 5558 | if (p->raw_status_new) | 5559 | if (p->raw_status_new) |
| 5559 | update_status (p); | 5560 | update_status (p); |
| @@ -5632,7 +5633,8 @@ send_process (proc, buf, len, object) | |||
| 5632 | } | 5633 | } |
| 5633 | 5634 | ||
| 5634 | len = coding->produced; | 5635 | len = coding->produced; |
| 5635 | buf = SDATA (coding->dst_object); | 5636 | dst_object = coding->dst_object; |
| 5637 | buf = SDATA (dst_object); | ||
| 5636 | } | 5638 | } |
| 5637 | 5639 | ||
| 5638 | if (pty_max_bytes == 0) | 5640 | if (pty_max_bytes == 0) |
| @@ -5764,7 +5766,7 @@ send_process (proc, buf, len, object) | |||
| 5764 | /* Running filters might relocate buffers or strings. | 5766 | /* Running filters might relocate buffers or strings. |
| 5765 | Arrange to relocate BUF. */ | 5767 | Arrange to relocate BUF. */ |
| 5766 | if (CODING_REQUIRE_ENCODING (coding)) | 5768 | if (CODING_REQUIRE_ENCODING (coding)) |
| 5767 | offset = buf - SDATA (coding->dst_object); | 5769 | offset = buf - SDATA (dst_object); |
| 5768 | else if (BUFFERP (object)) | 5770 | else if (BUFFERP (object)) |
| 5769 | offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); | 5771 | offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); |
| 5770 | else if (STRINGP (object)) | 5772 | else if (STRINGP (object)) |
| @@ -5777,7 +5779,7 @@ send_process (proc, buf, len, object) | |||
| 5777 | #endif | 5779 | #endif |
| 5778 | 5780 | ||
| 5779 | if (CODING_REQUIRE_ENCODING (coding)) | 5781 | if (CODING_REQUIRE_ENCODING (coding)) |
| 5780 | buf = offset + SDATA (coding->dst_object); | 5782 | buf = offset + SDATA (dst_object); |
| 5781 | else if (BUFFERP (object)) | 5783 | else if (BUFFERP (object)) |
| 5782 | buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); | 5784 | buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); |
| 5783 | else if (STRINGP (object)) | 5785 | else if (STRINGP (object)) |