rc_getline keeps expanding it's malloced buffer until it has read a whole line or EOF. All functions which read into static buffers have been changed to use fhis function to avoid any potential overflows and to ensure we really do read a long long config line.
This commit is contained in:
@ -451,7 +451,7 @@ static bool svc_exec (const char *arg1, const char *arg2)
|
||||
}
|
||||
|
||||
selfd = MAX (master_tty, signal_pipe[0]) + 1;
|
||||
buffer = xmalloc (sizeof (char) * RC_LINEBUFFER);
|
||||
buffer = xmalloc (sizeof (char) * BUFSIZ);
|
||||
while (1) {
|
||||
FD_ZERO (&rset);
|
||||
FD_SET (signal_pipe[0], &rset);
|
||||
@ -467,7 +467,7 @@ static bool svc_exec (const char *arg1, const char *arg2)
|
||||
|
||||
if (s > 0) {
|
||||
if (master_tty >= 0 && FD_ISSET (master_tty, &rset)) {
|
||||
bytes = read (master_tty, buffer, RC_LINEBUFFER);
|
||||
bytes = read (master_tty, buffer, BUFSIZ);
|
||||
write_prefix (buffer, bytes, &prefixed);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user