Page MenuHomeFreeBSD

Use strlcpy and snprintf in netstat(1).
ClosedPublic

Authored by delphij on Dec 26 2016, 4:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 13, 5:29 PM
Unknown Object (File)
Dec 23 2024, 11:34 AM
Unknown Object (File)
Dec 23 2024, 11:21 AM
Unknown Object (File)
Sep 18 2024, 5:03 PM
Unknown Object (File)
Sep 18 2024, 7:18 AM
Unknown Object (File)
Sep 9 2024, 5:21 PM
Unknown Object (File)
Sep 8 2024, 8:20 PM
Unknown Object (File)
Sep 7 2024, 9:11 AM
Subscribers

Details

Summary

Expand inet6name() line buffer to NI_MAXHOST and use
strlcpy/snprintf in various places, reported by Anton Yuzhaninov
<citrin citrin ru>.

Test Plan

exercise the affected code paths

Diff Detail

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

Event Timeline

delphij retitled this revision from to Use strlcpy and snprintf in netstat(1)..
delphij updated this object.
delphij edited the test plan for this revision. (Show Details)
delphij added reviewers: hrs, ae, glebius, tuexen.

I'm fine with the changes. In some places you add {} around single statements leasing to an inconsistent usage.
Please note that I'm normally in favor of code like
if (cond) {

statement;

} else {

statement;

}
but normally I try to follow how it is done elsewhere in the file... So is this intentionally?

hrs edited edge metadata.

Looks good to me.

This revision is now accepted and ready to land.Dec 28 2016, 11:25 AM
This revision was automatically updated to reflect the committed changes.