]> git.eshelyaron.com Git - emacs.git/commit
Consistently check for FD_SETSIZE overflow.
authorPhilipp Stephani <phst@google.com>
Wed, 30 Dec 2020 21:33:22 +0000 (22:33 +0100)
committerPhilipp Stephani <phst@google.com>
Wed, 30 Dec 2020 22:04:34 +0000 (23:04 +0100)
commit0ea7bb3578998ebdf7c4903e7f38a8abf2e41b68
tree1378d50b1c9a6eb5d2b863710fa8c0d01ab3281e
parent3a6137a498fe065cadbbf9a1f0575623155a9e55
Consistently check for FD_SETSIZE overflow.

Previously this was only checked in a few places.  Now assert that
file descriptors are within the expected range whenever we'd otherwise
introduce undefined behavior.

* src/process.c (add_read_fd, add_process_read_fd, delete_read_fd)
(recompute_max_desc, delete_write_fd, compute_input_wait_mask)
(compute_non_process_wait_mask, compute_non_keyboard_wait_mask)
(compute_write_mask, clear_waiting_thread_info)
(update_processes_for_thread_death, Fset_process_thread)
(create_process, create_pty, Fmake_pipe_process)
(Fprocess_datagram_address, Fset_process_datagram_address)
(Fmake_serial_process, finish_after_tls_connection)
(connect_network_socket, deactivate_process)
(server_accept_connection, wait_reading_process_output)
(read_process_output, read_and_dispose_of_process_output)
(send_process, Fcontinue_process, Fprocess_send_eof)
(Fprocess_filter_multibyte_p, keyboard_bit_set)
(add_timer_wait_descriptor, setup_process_coding_systems): Add
assertions to document and check that file descriptors are within the
expected range when used as file descriptor set elements or array
subscripts.
src/process.c