2005-05-20 Sergei Organov <osv@topconrd.ru>

PR 750/networking
	* pppd/sys-rtems.c: Avoid NULL dereference in wait_input().
This commit is contained in:
Joel Sherrill
2005-05-20 19:31:18 +00:00
parent c230bc312d
commit da56a02f6c
2 changed files with 17 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
2005-05-20 Sergei Organov <osv@topconrd.ru>
PR 750/networking
* pppd/sys-rtems.c: Avoid NULL dereference in wait_input().
2004-04-03 Wilfried Busalski <w.busalski@lancier-monitoring.de>
PR 599/pppd

View File

@@ -513,13 +513,21 @@ void
wait_input(timo)
struct timeval *timo;
{
rtems_interval ticks;
rtems_event_set events;
rtems_interval ticks = 0;
rtems_option wait = RTEMS_WAIT;
ticks = ((timo->tv_sec*1000000)+timo->tv_usec)/rtems_bsdnet_microseconds_per_tick;
if ( ticks > 0 ) {
rtems_event_receive(RTEMS_EVENT_31, (RTEMS_EVENT_ANY|RTEMS_WAIT), ticks, &events);
if(timo) {
if(timo->tv_sec == 0 && timo->tv_usec == 0)
wait = RTEMS_NO_WAIT;
else {
ticks = (timo->tv_sec * 1000000 + timo->tv_usec) /
rtems_bsdnet_microseconds_per_tick;
if(ticks <= 0)
ticks = 1;
}
}
rtems_event_receive(RTEMS_EVENT_31, RTEMS_EVENT_ANY | wait, ticks, &events);
}
/*