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
F174629398: D21325.id61002.diff
Sun, Oct 4, 7:15 PM
F174594088: D21325.id61006.diff
Sun, Oct 4, 12:53 PM
Unknown Object (File)
Sat, Oct 3, 1:08 PM
Unknown Object (File)
Tue, Sep 29, 10:44 PM
Unknown Object (File)
Tue, Sep 29, 10:41 PM
Unknown Object (File)
Tue, Sep 29, 7:51 PM
Unknown Object (File)
Sun, Sep 20, 6:40 AM
Unknown Object (File)
Sun, Sep 13, 10:46 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