summaryrefslogtreecommitdiff
path: root/src/callproc.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2012-12-05 19:39:39 +0200
committerEli Zaretskii <eliz@gnu.org>2012-12-05 19:39:39 +0200
commit7c2fcf9bad2bed6c0198875384dc2bdb7cbd7e99 (patch)
tree0c6c3111399e34dd12e6a976934615810878be67 /src/callproc.c
parentd3cefd1358e021cc4d510afb18916b067e6b1419 (diff)
downloademacs-7c2fcf9bad2bed6c0198875384dc2bdb7cbd7e99.tar.gz
Don't pass un-encoded file name to mkstemp.
src/callproc.c (Fcall_process_region): Encode expanded temp file pattern before passing it to mkstemp or mktemp.
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/callproc.c b/src/callproc.c
index ce3b11af696..d152da19f7b 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -959,8 +959,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
{
USE_SAFE_ALLOCA;
Lisp_Object pattern = Fexpand_file_name (Vtemp_file_name_pattern, tmpdir);
- char *tempfile = SAFE_ALLOCA (SBYTES (pattern) + 1);
- memcpy (tempfile, SDATA (pattern), SBYTES (pattern) + 1);
+ Lisp_Object encoded_tem = ENCODE_FILE (pattern);
+ char *tempfile = SAFE_ALLOCA (SBYTES (encoded_tem) + 1);
+ memcpy (tempfile, SDATA (encoded_tem), SBYTES (encoded_tem) + 1);
coding_systems = Qt;
#ifdef HAVE_MKSTEMP