summaryrefslogtreecommitdiff
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-24 10:29:05 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-28 09:05:47 +0100
commitc80f6aa9161e10259127b3b9abe7717c702daf39 (patch)
treefa83592d69bfdcf41bf15cc932636e2f4f19ed3d /testsuites/libtests
parent9fa0f543ecfcf6cdf79d60a3a9f5a0ed845c7046 (diff)
termios: Fix infinite loop in receive path
In canonical mode, the raw input buffer or the canonical buffer may overflow without an end of line. Avoid an infinite loop in this case. Close #2915.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/termios09/init.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/testsuites/libtests/termios09/init.c b/testsuites/libtests/termios09/init.c
index a32ebdaec5..980a6ea9ec 100644
--- a/testsuites/libtests/termios09/init.c
+++ b/testsuites/libtests/termios09/init.c
@@ -550,6 +550,9 @@ static void test_rx_callback_icanon(test_context *ctx)
input(ctx, i, 'e');
rtems_test_assert(dev->callback_counter == 5);
+ n = read(ctx->fds[i], buf, 255);
+ rtems_test_assert(n == 255);
+
dev->tty->tty_rcv.sw_pfn = NULL;
dev->tty->tty_rcv.sw_arg = NULL;
set_veol_veol2(ctx, i, '\0', '\0');