diff options
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/callproc.c b/src/callproc.c index f148f6233d4..1bdb57a27d0 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -252,7 +252,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 252 | val = Qraw_text; | 252 | val = Qraw_text; |
| 253 | else | 253 | else |
| 254 | { | 254 | { |
| 255 | SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2); | 255 | SAFE_NALLOCA (args2, 1, nargs + 1); |
| 256 | args2[0] = Qcall_process; | 256 | args2[0] = Qcall_process; |
| 257 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | 257 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; |
| 258 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); | 258 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); |
| @@ -603,6 +603,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 603 | 603 | ||
| 604 | /* vfork, and prevent local vars from being clobbered by the vfork. */ | 604 | /* vfork, and prevent local vars from being clobbered by the vfork. */ |
| 605 | { | 605 | { |
| 606 | Lisp_Object volatile buffer_volatile = buffer; | ||
| 607 | Lisp_Object volatile coding_systems_volatile = coding_systems; | ||
| 608 | Lisp_Object volatile current_dir_volatile = current_dir; | ||
| 606 | int volatile fd1_volatile = fd1; | 609 | int volatile fd1_volatile = fd1; |
| 607 | int volatile fd_error_volatile = fd_error; | 610 | int volatile fd_error_volatile = fd_error; |
| 608 | int volatile fd_output_volatile = fd_output; | 611 | int volatile fd_output_volatile = fd_output; |
| @@ -611,6 +614,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 611 | 614 | ||
| 612 | pid = vfork (); | 615 | pid = vfork (); |
| 613 | 616 | ||
| 617 | buffer = buffer_volatile; | ||
| 618 | coding_systems = coding_systems_volatile; | ||
| 619 | current_dir = current_dir_volatile; | ||
| 614 | fd1 = fd1_volatile; | 620 | fd1 = fd1_volatile; |
| 615 | fd_error = fd_error_volatile; | 621 | fd_error = fd_error_volatile; |
| 616 | fd_output = fd_output_volatile; | 622 | fd_output = fd_output_volatile; |
| @@ -720,7 +726,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 720 | { | 726 | { |
| 721 | ptrdiff_t i; | 727 | ptrdiff_t i; |
| 722 | 728 | ||
| 723 | SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2); | 729 | SAFE_NALLOCA (args2, 1, nargs + 1); |
| 724 | args2[0] = Qcall_process; | 730 | args2[0] = Qcall_process; |
| 725 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | 731 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; |
| 726 | coding_systems | 732 | coding_systems |
| @@ -1018,7 +1024,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 1018 | else | 1024 | else |
| 1019 | { | 1025 | { |
| 1020 | USE_SAFE_ALLOCA; | 1026 | USE_SAFE_ALLOCA; |
| 1021 | SAFE_ALLOCA (args2, Lisp_Object *, (nargs + 1) * sizeof *args2); | 1027 | SAFE_NALLOCA (args2, 1, nargs + 1); |
| 1022 | args2[0] = Qcall_process_region; | 1028 | args2[0] = Qcall_process_region; |
| 1023 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; | 1029 | for (i = 0; i < nargs; i++) args2[i + 1] = args[i]; |
| 1024 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); | 1030 | coding_systems = Ffind_operation_coding_system (nargs + 1, args2); |
| @@ -1147,7 +1153,7 @@ child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L | |||
| 1147 | cleaned up in the usual way. */ | 1153 | cleaned up in the usual way. */ |
| 1148 | { | 1154 | { |
| 1149 | register char *temp; | 1155 | register char *temp; |
| 1150 | register int i; | 1156 | size_t i; /* size_t, because ptrdiff_t might overflow here! */ |
| 1151 | 1157 | ||
| 1152 | i = SBYTES (current_dir); | 1158 | i = SBYTES (current_dir); |
| 1153 | #ifdef MSDOS | 1159 | #ifdef MSDOS |