mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
fsp: Assert that there is room for a terminating null.
This commit is contained in:
parent
368a749123
commit
23b4b912ac
@ -296,6 +296,15 @@ fsp_got_error(struct socket *socket, struct read_buffer *rb)
|
||||
return;
|
||||
}
|
||||
|
||||
/* There should be free space in the buffer, because
|
||||
* @alloc_read_buffer allocated several kibibytes, and the
|
||||
* child process wrote only an integer and a newline to the
|
||||
* pipe. */
|
||||
assert(rb->freespace >= 1);
|
||||
if_assert_failed {
|
||||
abort_connection(conn, S_INTERNAL);
|
||||
return;
|
||||
}
|
||||
rb->data[len] = '\0';
|
||||
error = atoi(rb->data);
|
||||
kill_buffer_data(rb, len);
|
||||
|
Loading…
Reference in New Issue
Block a user