[rtems commit] libtests/termios04: Avoid NULL pointer access
Sebastian Huber
sebh at rtems.org
Tue Sep 17 11:52:34 UTC 2013
Module: rtems
Branch: master
Commit: d9998172a062d1d8b730b4d3cae10f3876e967e5
Changeset: http://git.rtems.org/rtems/commit/?id=d9998172a062d1d8b730b4d3cae10f3876e967e5
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Sep 17 13:48:30 2013 +0200
libtests/termios04: Avoid NULL pointer access
---
.../libtests/termios04/termios_testdriver_intr.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/testsuites/libtests/termios04/termios_testdriver_intr.c b/testsuites/libtests/termios04/termios_testdriver_intr.c
index 72a5f9e..d7d1d9e 100644
--- a/testsuites/libtests/termios04/termios_testdriver_intr.c
+++ b/testsuites/libtests/termios04/termios_testdriver_intr.c
@@ -153,9 +153,12 @@ ssize_t termios_test_driver_write_helper(
size_t len
)
{
- Tx_Buffer[Tx_Index++] = buf[0];
- (void) rtems_timer_fire_after( Tx_Timer, 10, Tx_ISR, NULL );
- return 1;
+ if (len > 0) {
+ Tx_Buffer[Tx_Index++] = buf[0];
+ (void) rtems_timer_fire_after( Tx_Timer, 10, Tx_ISR, NULL );
+ }
+
+ return 0;
}
/*
More information about the vc
mailing list