summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-19 20:23:32 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-08-19 20:23:32 +0000
commit32a46df3bacb0314b90731ac6b89d5a4f2120955 (patch)
treeaa4ff10ef7e616159fd85e4cdb1778bb56435eaf
parent08e49237760723a8dd60c786f63cea8beb50fe9f (diff)
2008-08-19 Cedric Aubert <cedric_aubert@yahoo.fr>
PR 500/misc * libcsupport/src/termios.c: Avoid potential buffer overflow.
-rw-r--r--cpukit/ChangeLog5
-rw-r--r--cpukit/libcsupport/src/termios.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 9690defca1..f1b17c2e07 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-19 Cedric Aubert <cedric_aubert@yahoo.fr>
+
+ PR 500/misc
+ * libcsupport/src/termios.c: Avoid potential buffer overflow.
+
2008-08-15 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1297/cpukit
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;