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
Unknown Object (File)
Sun, Jan 18, 4:40 PM
Unknown Object (File)
Sat, Jan 17, 1:10 PM
Unknown Object (File)
Sat, Jan 17, 12:07 PM
Unknown Object (File)
Sat, Jan 17, 2:48 AM
Unknown Object (File)
Sat, Jan 17, 12:29 AM
Unknown Object (File)
Tue, Jan 13, 10:21 PM
Unknown Object (File)
Mon, Dec 29, 5:11 AM
Unknown Object (File)
Nov 30 2025, 8:03 AM
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