Page MenuHomeFreeBSD

ping: increase buffer size for the string representation of n_time
ClosedPublic

Authored by jansucan on Aug 19 2019, 4:59 PM.
Tags
None
Referenced Files
F168911010: D21325.id61006.diff
Sun, Aug 30, 5:28 PM
Unknown Object (File)
Sat, Aug 15, 3:19 PM
Unknown Object (File)
Wed, Aug 12, 6:39 AM
Unknown Object (File)
Sat, Aug 8, 10:36 PM
Unknown Object (File)
Fri, Aug 7, 12:24 AM
Unknown Object (File)
Jul 13 2026, 6:04 AM
Unknown Object (File)
Jun 27 2026, 7:42 AM
Unknown Object (File)
Jun 15 2026, 3:13 PM
Subscribers

Details

Summary

Increase buffer size for the string representation of n_time

This fixes -Wformat-truncation warning when compiled with GCC.

ICMP timestamp is a 32-bit number. In pr_ntime(), number of minutes
and seconds is always 2 characters wide. Max. number of hours is 4
characters wide. The buffer size should be at least:

4 + 2 + 2 + 1 (':') + 1 (':') + 1 ('\0') = 11

Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google, inc. (Google Summer of Code 2019)

Diff Detail

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