From 5cf2b69bdba39fd653d34c74e207ac3e4c48260d Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sun, 14 Aug 2011 13:51:08 -0400 Subject: [PATCH] Avoid crash with invalid default-process-coding-system. * src/process.c (create_process): Call setup_process_coding_systems after the pid of the process is set to -1. --- src/ChangeLog | 5 +++++ src/process.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b5da1be5c7d..40a0ed24e6a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-08-14 Kenichi Handa + + * process.c (create_process): Call setup_process_coding_systems + after the pid of the process is set to -1. + 2011-08-14 Eli Zaretskii * xdisp.c (move_it_in_display_line_to): Don't invoke diff --git a/src/process.c b/src/process.c index 9d20d0c2b09..71a6f91a7bb 100644 --- a/src/process.c +++ b/src/process.c @@ -1643,7 +1643,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) XPROCESS (process)->pty_flag = pty_flag; XPROCESS (process)->status = Qrun; - setup_process_coding_systems (process); /* Delay interrupts until we have a chance to store the new fork's pid in its process structure */ @@ -1678,6 +1677,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) processes to get their return values scrambled. */ XPROCESS (process)->pid = -1; + /* This must be called after the above line because it may signal an + error. */ + setup_process_coding_systems (process); + BLOCK_INPUT; { -- 2.39.2