Page MenuHomeFreeBSD

ping6: Fix dnsdecode() bug introduced by r350859
ClosedPublic

Authored by jansucan on Aug 15 2019, 7:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 16 2024, 11:46 AM
Unknown Object (File)
Feb 21 2024, 5:56 AM
Unknown Object (File)
Jan 11 2024, 10:54 AM
Unknown Object (File)
Dec 22 2023, 10:40 PM
Unknown Object (File)
Dec 21 2023, 7:10 PM
Unknown Object (File)
Nov 6 2023, 9:58 PM
Unknown Object (File)
Nov 3 2023, 2:09 PM
Unknown Object (File)
Sep 16 2023, 12:11 AM
Subscribers

Details

Summary

Fix dnsdecode() bug introduced by r350859

r350859 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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sbin/ping6/ping6.c
1431 ↗(On Diff #60819)

Since you're here, could you document dnsdecode's arguments and return value?

Document dnsdecode's arguments and return value.

sbin/ping6/ping6.c
1431 ↗(On Diff #60819)

Fixed. However, I'm a bit unsure about the RFC because the function doesn't seem to follow it completely.

This revision is now accepted and ready to land.Aug 17 2019, 2:21 PM
This revision was automatically updated to reflect the committed changes.