Introduce strlcat() instead of strcat(), and replace all sizeof() of buffers inside structures with constants where possible, to avoid bugs caused by reading the size of a pointer instead of the size of the buffer it points to.

This commit is contained in:
Andrew Wood
2023-07-23 01:57:00 +01:00
parent 80e3f791c4
commit c7e0bb727e
12 changed files with 171 additions and 80 deletions
+1
View File
@@ -8,6 +8,7 @@
* cleanup: improved the output formatting of "`make test`"
* cleanup: skip test 10 (for *SIGPIPE*) if GNU "`head`" is not available, so "`make test`" on stock OpenBSD 7.3 works
* cleanup: replace all calls to `sprintf()` and `snprintf()` with a new wrapper function `pv_snprintf()` to centralise compatibility changes
* cleanup: replace all calls to `strcat()` with a wrapper `pv_strlcat()` to improve security and compatibility
* cleanup: tidy up and fix compilation warning in "`--watchfd`" code
* cleanup: replace all `write()` calls to the terminal with a wrapper `pv_write_retry()` for consistency