HomeFreeBSD

ping6: Fix dnsdecode() bug introduced by r350859

Description

ping6: Fix dnsdecode() bug introduced by r350859

Revision 350859 removed level of indirection that was needed for setting the
caller's `cp' pointer. dnsdecode() uses return value to indicate error or
success. It returns pointer to a buffer holding a decompressed DNS name or
NULL. The caller uses that value only to find out the result, not for accessing
the buffer.

We use the return value to propagate the new value of `cp' pointer to
the caller instead of using an output argument.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
MFC-With: 350859
Sponsored by: Google, Inc (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21266

Details

Provenance
asomersAuthored on
Differential Revision
D21266: ping6: Fix dnsdecode() bug introduced by r350859
Parents
rS351169: SDP: Fix brain-o from r351162
Branches
Unknown
Tags
Unknown