diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-07-07 10:40:26 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-07-07 10:40:26 +0000 |
commit | 4830b6f9f5344c8ce04b073e7209b04599f8a01a (patch) | |
tree | c1a1a17bd47e8b0c7690dd619b5ce7ebe59a9cfc /sbin/dhcpleased | |
parent | 2f1169179b84735300e41378dbcc1531660ccb72 (diff) |
Handle strange format strings better.
Make sure that the allocated buffers are not zero sized even for an empty
format string. Also do not call strftime if the buffer is empty. The return
value of strftime does not distinguish between an empty format string and
an overflow of the output buffer. Finally auto scale the size of the outbuf
in case strftime fails. Some format specifiers expand to 25 and more chars
so it is hard to guess in advance what size is required.
This may waste some memory but it keeps the code as simple as possible.
OK tb@
Diffstat (limited to 'sbin/dhcpleased')
0 files changed, 0 insertions, 0 deletions