Project

General

Profile

Actions

Bug #5643

closed

_netdir_options(): _nderror is not set on failure

Added by Marcel Telka over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
lib - userland libraries
Start date:
2015-02-19
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

The _netdir_options() function in straddr does not set _nderror to ND_NOMEM after the alloc failure at line 388:

375int
376_netdir_options(struct netconfig *netconfigp, int option, int fd, void *par)
377{
378    struct nd_mergearg *argp;  /* the argument for mergeaddr */
379
380    switch (option) {
381    case ND_MERGEADDR:
382        /*
383         *    Translate the universal address into something that
384         *    makes sense to the caller.  This is a no-op in
385         *    loopback's case, so just return the universal address.
386         */
387        argp = (struct nd_mergearg *)par;
388        argp->m_uaddr = strdup(argp->s_uaddr);
389        return (argp->m_uaddr == NULL? -1 : 0);
390    default:
391        _nderror = ND_NOCTRL;
392        return (-1);
393    }
394}
Actions

Also available in: Atom PDF