summaryrefslogtreecommitdiff
path: root/src/rc/runscript.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-07 12:29:30 +0000
committerRoy Marples <roy@marples.name>2008-01-07 12:29:30 +0000
commit43d0f3fc76542d0859c9b84402c0483a22e02b68 (patch)
tree125bcc9bf644a6390718868312df2b6be1905e89 /src/rc/runscript.c
parent74e0e58b899accd2bd72a7d7303331e47089959f (diff)
downloadopenrc-43d0f3fc76542d0859c9b84402c0483a22e02b68.tar.gz
openrc-43d0f3fc76542d0859c9b84402c0483a22e02b68.tar.bz2
openrc-43d0f3fc76542d0859c9b84402c0483a22e02b68.tar.xz
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.
Diffstat (limited to 'src/rc/runscript.c')
-rw-r--r--src/rc/runscript.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index fdb0496..0e750c5 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -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);
}