Changeset 9f114a8 in rtems


Ignore:
Timestamp:
05/20/05 19:33:23 (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
182813e
Parents:
862cbe3a
Message:

2005-05-20 Sergei Organov <osv@…>

PR 750/networking

  • libnetworking/pppd/sys-rtems.c: Avoid NULL dereference in wait_input().
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    r862cbe3a r9f114a8  
     12005-05-20      Sergei Organov  <osv@topconrd.ru>
     2
     3        PR 750/networking
     4        * libnetworking/pppd/sys-rtems.c: Avoid NULL dereference in
     5        wait_input().
     6
    172005-05-17      Jennifer Averett <jennifer.averett@oarcorp.com>
    28
  • c/src/libnetworking/pppd/sys-rtems.c

    r862cbe3a r9f114a8  
    514514    struct timeval *timo;
    515515{
    516   rtems_interval     ticks;
    517516  rtems_event_set    events;
    518 
    519   ticks = ((timo->tv_sec*1000000)+timo->tv_usec)/rtems_bsdnet_microseconds_per_tick;
    520   if ( ticks > 0 ) {
    521     rtems_event_receive(RTEMS_EVENT_31, (RTEMS_EVENT_ANY|RTEMS_WAIT), ticks, &events);
     517  rtems_interval     ticks = 0;
     518  rtems_option       wait = RTEMS_WAIT;
     519
     520  if(timo) {
     521    if(timo->tv_sec == 0 && timo->tv_usec == 0)
     522      wait = RTEMS_NO_WAIT;
     523    else {
     524      ticks = (timo->tv_sec * 1000000 + timo->tv_usec) /
     525        rtems_bsdnet_microseconds_per_tick;
     526      if(ticks <= 0)
     527        ticks = 1;
     528    }
    522529  }
     530  rtems_event_receive(RTEMS_EVENT_31, RTEMS_EVENT_ANY | wait, ticks, &events);
    523531}
    524532
  • cpukit/pppd/sys-rtems.c

    r862cbe3a r9f114a8  
    514514    struct timeval *timo;
    515515{
    516   rtems_interval     ticks;
    517516  rtems_event_set    events;
    518 
    519   ticks = ((timo->tv_sec*1000000)+timo->tv_usec)/rtems_bsdnet_microseconds_per_tick;
    520   if ( ticks > 0 ) {
    521     rtems_event_receive(RTEMS_EVENT_31, (RTEMS_EVENT_ANY|RTEMS_WAIT), ticks, &events);
     517  rtems_interval     ticks = 0;
     518  rtems_option       wait = RTEMS_WAIT;
     519
     520  if(timo) {
     521    if(timo->tv_sec == 0 && timo->tv_usec == 0)
     522      wait = RTEMS_NO_WAIT;
     523    else {
     524      ticks = (timo->tv_sec * 1000000 + timo->tv_usec) /
     525        rtems_bsdnet_microseconds_per_tick;
     526      if(ticks <= 0)
     527        ticks = 1;
     528    }
    522529  }
     530  rtems_event_receive(RTEMS_EVENT_31, RTEMS_EVENT_ANY | wait, ticks, &events);
    523531}
    524532
Note: See TracChangeset for help on using the changeset viewer.