Commit 7c2fcf9b authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

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.
parent d3cefd13
......@@ -3,6 +3,8 @@
* callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
fails, signal an error instead of continuing with an empty
string. (Bug#13079)
Encode expanded temp file pattern before passing it to mkstemp or
mktemp.
2012-12-04 Eli Zaretskii <eliz@gnu.org>
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment