From a0241d014e3d762bc7818d6cd8fd7c90bab3c538 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 7 Nov 2011 10:57:07 +0900 Subject: [PATCH] Set members of the struct coding_system before accessing them (bug#9910,9911,9912). --- src/ChangeLog | 11 +++++++++++ src/callproc.c | 1 + src/coding.c | 2 +- src/process.c | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index f198f37d0c1..3af9590134c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2011-11-07 Kenichi Handa + + * coding.c (coding_set_destination): Check coding->src_pos only + when coding->src_object is a buffer (bug#9910). + + * process.c (send_process): Set the member src_multibyte of coding + to 0 (bug#9911) when sending a unibyte text. + + * callproc.c (Fcall_process): Set the member src_multibyte of + process_coding to 0 (bug#9912). + 2011-11-03 Eli Zaretskii * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947) diff --git a/src/callproc.c b/src/callproc.c index 97531f73848..0859aaef2e6 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -748,6 +748,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) val = raw_text_coding_system (val); setup_coding_system (val, &process_coding); } + process_coding.src_multibyte = 0; immediate_quit = 1; QUIT; diff --git a/src/coding.c b/src/coding.c index 5fd59d394d9..79908e9b29b 100644 --- a/src/coding.c +++ b/src/coding.c @@ -1043,7 +1043,7 @@ coding_set_destination (struct coding_system *coding) { if (BUFFERP (coding->dst_object)) { - if (coding->src_pos < 0) + if (BUFFERP (coding->src_object) && coding->src_pos < 0) { coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE; coding->dst_bytes = (GAP_END_ADDR diff --git a/src/process.c b/src/process.c index c316139a713..301274676d6 100644 --- a/src/process.c +++ b/src/process.c @@ -5387,6 +5387,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, } else { + coding->src_multibyte = 0; /* For sending a unibyte text, character code conversion should not take place but EOL conversion should. So, setup raw-text or one of the subsidiary if we have not yet done it. */ -- 2.39.2