]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid assertion violation in callproc.c
authorEli Zaretskii <eliz@gnu.org>
Wed, 10 Feb 2021 18:04:26 +0000 (20:04 +0200)
committerEli Zaretskii <eliz@gnu.org>
Wed, 10 Feb 2021 18:04:26 +0000 (20:04 +0200)
* src/callproc.c (call_process): Avoid assertion violation when
DESTINATION is a cons cell '(:file . "FOO")'.  (Bug#46426)

src/callproc.c

index 5b1d8bfb76543bafff12557375b668101aac9d01..3eac38d375aead977682b109f438fceb7a2b093c 100644 (file)
@@ -394,7 +394,11 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
       /* If the buffer is (still) a list, it might be a (:file "file") spec. */
       if (CONSP (buffer) && EQ (XCAR (buffer), QCfile))
        {
-         output_file = Fexpand_file_name (XCAR (XCDR (buffer)),
+         Lisp_Object ofile = XCDR (buffer);
+         if (CONSP (ofile))
+           ofile = XCAR (ofile);
+         CHECK_STRING (ofile);
+         output_file = Fexpand_file_name (ofile,
                                           BVAR (current_buffer, directory));
          CHECK_STRING (output_file);
          buffer = Qnil;