]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid segfault in processes of type 'pipe'
authorEli Zaretskii <eliz@gnu.org>
Fri, 13 Apr 2018 12:48:04 +0000 (15:48 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 13 Apr 2018 12:48:04 +0000 (15:48 +0300)
* src/process.c (Fmake_pipe_process): Set up the decoding and
encoding buffers.  For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00295.html.

src/process.c

index b201e9b6acccb5e68911e976f45f823750801780..45ab1fd7245441de722273de91b40a5109b771b0 100644 (file)
@@ -2461,6 +2461,10 @@ usage:  (make-pipe-process &rest ARGS)  */)
   /* This may signal an error.  */
   setup_process_coding_systems (proc);
 
+  pset_decoding_buf (p, empty_unibyte_string);
+  eassert (p->decoding_carryover == 0);
+  pset_encoding_buf (p, empty_unibyte_string);
+
   specpdl_ptr = specpdl + specpdl_count;
 
   return proc;