Kinsey Moore commented on a discussion on rtemslwip/common/network_compat.c: 
https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/28#note_130532

 > +static char hostname[_POSIX_HOST_NAME_MAX] = {0};
 > +static int hostname_len = 1;
 > +
 > +int gethostname(char *name, size_t size)
 > +{
 > +    int copy_size = hostname_len;
 > +
 > +    if (name == NULL) {
 > +        errno = EFAULT;
 > +        return -1;
 > +    }
 > +    if (copy_size > size) {
 > +        copy_size = size;
 > +    }
 > +
 > +    memcpy(name, hostname, copy_size);

Updated with an additional check for 0 size input.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/28#note_130532
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
bugs@rtems.org
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to