Changeset d030c4e7 in rtems


Ignore:
Timestamp:
Aug 28, 2007, 2:06:29 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
a8e030d
Parents:
c3b4fc1
Message:

2007-08-28 Joel Sherrill <joel.sherrill@…>

PR 1256/networking

  • ftpd/ftpd.c: Fix unaligned access.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rc3b4fc1 rd030c4e7  
     12007-08-28      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        PR 1256/networking
     4        * ftpd/ftpd.c: Fix unaligned access.
     5
    162007-08-28      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • cpukit/ftpd/ftpd.c

    rc3b4fc1 rd030c4e7  
    14371437  {
    14381438    int i;
    1439     uint8_t b[NUM_FIELDS];
     1439    union {
     1440      uint8_t b[NUM_FIELDS];
     1441      struct {
     1442        uint32_t ip;
     1443        uint16_t port;
     1444      };
     1445    } ip_info;
    14401446
    14411447    for(i = 0; i < NUM_FIELDS; ++i)
     
    14431449      if(a[i] > 255)
    14441450        break;
    1445       b[i] = (uint8_t)a[i];
     1451      ip_info.b[i] = (uint8_t)a[i];
    14461452    }
    14471453
     
    14511457       * to specify IP address different than those of the originating client
    14521458       * for the sake of safety. */
    1453       uint32_t const *ip   = (uint32_t *)b;
    1454       if(*ip == info->def_addr.sin_addr.s_addr)
     1459      if (ip_info.ip == info->def_addr.sin_addr.s_addr)
    14551460      {
    1456         info->data_addr.sin_addr.s_addr = *ip;
    1457         info->data_addr.sin_port        = *(uint16_t *)(b + 4);
     1461        info->data_addr.sin_addr.s_addr = ip_info.ip;
     1462        info->data_addr.sin_port        = ip_info.port;
    14581463        info->data_addr.sin_family      = AF_INET;
    14591464        memset(info->data_addr.sin_zero, 0, sizeof(info->data_addr.sin_zero));
Note: See TracChangeset for help on using the changeset viewer.