Changeset 479a28e0 in rtems


Ignore:
Timestamp:
Oct 5, 2018, 12:54:49 PM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
df97c4d2
Parents:
51da629
Message:

ftpd: Avoid use of uninitialized memory

Update #3530.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ftpd/ftpd.c

    r51da629 r479a28e0  
    19691969  socklen_t           addrLen;
    19701970  struct sockaddr_in  addr;
    1971   FTPD_SessionInfo_t  *info = NULL;
    1972 
    1973 
    1974   s = socket(PF_INET, SOCK_STREAM, 0);
    1975   if (s < 0)
    1976     syslog(LOG_ERR, "ftpd: Error creating socket: %s", serr());
    1977 
     1971
     1972  memset(&addr, 0, sizeof(addr));
    19781973  addr.sin_family      = AF_INET;
    19791974  addr.sin_port        = htons(ftpd_config->port);
    19801975  addr.sin_addr.s_addr = htonl(INADDR_ANY);
    1981   memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
    1982 
    1983   if (0 > bind(s, (struct sockaddr *)&addr, sizeof(addr)))
     1976
     1977  s = socket(PF_INET, SOCK_STREAM, 0);
     1978  if (s < 0)
     1979    syslog(LOG_ERR, "ftpd: Error creating control socket: %s", serr());
     1980  else if (0 > bind(s, (struct sockaddr *)&addr, sizeof(addr)))
    19841981    syslog(LOG_ERR, "ftpd: Error binding control socket: %s", serr());
    19851982  else if (0 > listen(s, 1))
     
    19961993    else
    19971994    {
     1995      FTPD_SessionInfo_t *info;
     1996
    19981997      info = task_pool_obtain();
    19991998      if (NULL == info)
Note: See TracChangeset for help on using the changeset viewer.