From 0e4e56ba2a8bbca43a383b503507e521c6476001 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 19 Aug 2008 20:20:34 +0000 Subject: [PATCH] 2008-08-19 Cedric Aubert PR 500/misc * libcsupport/src/termios.c: Avoid potential buffer overflow. --- cpukit/ChangeLog | 5 +++++ cpukit/libcsupport/src/termios.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 30eb04d412..6c23e86913 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2008-08-19 Cedric Aubert + + PR 500/misc + * libcsupport/src/termios.c: Avoid potential buffer overflow. + 2008-08-19 Joel Sherrill * libnetworking/kern/kern_sysctl.c, libnetworking/libc/res_debug.c: Fix diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index 732964ffb5..c6033ed388 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -1021,7 +1021,8 @@ fillBufferQueue (struct rtems_termios_tty *tty) /* * Process characters read from raw queue */ - while (tty->rawInBuf.Head != tty->rawInBuf.Tail) { + while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) && + (tty->ccount < (CBUFSIZE-1))) { unsigned char c; unsigned int newHead;