RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1083018 - code defect support/export/hostname.c: host_pton() NULL pointer process
Summary: code defect support/export/hostname.c: host_pton() NULL pointer process
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: JianHong Yin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-01 10:33 UTC by JianHong Yin
Modified: 2015-03-05 13:11 UTC (History)
0 users

Fixed In Version: nfs-utils-1.3.0-0.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:11:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0508 0 normal SHIPPED_LIVE nfs-utils bug fix and enhancement update 2015-03-05 16:14:48 UTC

Description JianHong Yin 2014-04-01 10:33:32 UTC
Description of problem:

struct addrinfo *
host_pton(const char *paddr)
{
        struct addrinfo *ai = NULL;
        struct addrinfo hint = {
                /* don't return duplicates */
                .ai_protocol    = (int)IPPROTO_UDP,
                .ai_flags       = AI_NUMERICHOST,
                .ai_family      = AF_UNSPEC,
        };
        struct sockaddr_in sin;
        int error, inet4;

        /*
         * Although getaddrinfo(3) is easier to use and supports
         * IPv6, it recognizes incomplete addresses like "10.4"
         * as valid AF_INET addresses.  It also accepts presentation
         * addresses that end with a blank.
         *
         * inet_pton(3) is much stricter.  Use it to be certain we
         * have a real AF_INET presentation address, before invoking
         * getaddrinfo(3) to generate the full addrinfo list.
         */
        inet4 = 1;
        if (inet_pton(AF_INET, paddr, &sin.sin_addr) == 0)
                inet4 = 0;

        error = getaddrinfo(paddr, NULL, &hint, &ai);
        switch (error) {
        case 0:
                if (!inet4 && ai->ai_addr->sa_family == AF_INET) {
                        freeaddrinfo(ai);
                        break;
                }
                return ai;
        case EAI_NONAME:
                if (paddr == NULL)  //this is too late,
                ^^^^ if paddr is NULL, the inet_pton() will segment fault.
                     should move to before calling inet_pton()

                        xlog(D_GENERAL, "%s: passed a NULL presentation address",
                                __func__);
                break;

Version-Release number of selected component (if applicable):
nfs-utils-1.3.0

How reproducible:
1

Steps to Reproduce:
1. code review
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 errata-xmlrpc 2015-03-05 13:11:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0508.html


Note You need to log in before you can comment on or make changes to this bug.