Changeset d29f206 in rtems


Ignore:
Timestamp:
Dec 6, 2012, 8:48:16 AM (9 years ago)
Author:
Dylan Maxwell <dylan.maxwell@…>
Branches:
4.10
Children:
073e3e10
Parents:
c160bc2
git-author:
Dylan Maxwell <dylan.maxwell@…> (12/06/12 08:48:16)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/06/12 08:50:20)
Message:

tftpfs: PR1624: Fix parsing of hostnames and paths

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/lib/tftpDriver.c

    rc160bc2 rd29f206  
    575575    hostname = full_path_name;
    576576    cp1 = strchr (full_path_name, ':');
    577     if (!cp1)
     577    if (!cp1) /* if can't use : as delimiter, try / */
     578        cp1 = strchr (full_path_name, '/');
     579    if (!cp1) {
    578580        hostname = "BOOTP_HOST";
     581        cp1 = full_path_name;
     582    }
    579583    else {
    580584        *cp1 = '\0';
     
    592596            return ENOENT;
    593597        memcpy (&farAddress, he->h_addr, sizeof (farAddress));
    594     } else {
    595         return ENOENT;
    596598    }
    597599   
     
    785787    device =
    786788      rtems_filesystem_mount_device (rtems_filesystem_location_mount (&iop->pathinfo));
    787     dlen = strlen (device);
    788     if (dlen == 0)
    789         rtems_set_errno_and_return_minus_one (ENOENT);
    790 
    791     if (iop->pathinfo.node_access_2 == NULL)
     789    dlen = device ? strlen(device) : 0;
     790
     791    if (iop->pathinfo.node_access == NULL || iop->pathinfo.node_access_2 == NULL)
    792792        rtems_set_errno_and_return_minus_one (ENOENT);
    793793
     
    825825    if (full_path_name == NULL)
    826826        rtems_set_errno_and_return_minus_one(ENOMEM);
    827     strcpy (full_path_name, device);
     827    if (dlen)
     828        strcpy (full_path_name, device);
     829    else
     830        strcpy (full_path_name, "");
    828831    if (nalen)
    829832      strcat (full_path_name, na);
Note: See TracChangeset for help on using the changeset viewer.