Improved safety when copying things into strings

Created "safe_" variations of 'strncpy()', 'strncat()',
and 'snprintf()', to ensure a truncated source string doesn't
leave the destination buffer without a NUL termination character.

Replaced all calls (in "tuxpaint.c" only, so far) to the standard
functions with calls to the new safer versions.

Replaced most calls to plain 'strcpy()', 'strcat()' and
'sprintf()' (which can cause buffer overruns) with the new functions.
This commit is contained in:
Bill Kendrick 2020-07-26 16:13:53 -07:00
parent 56591258ff
commit e50a0ef84c
2 changed files with 212 additions and 173 deletions

View file

@ -34,6 +34,10 @@ $Id$
(Ref: https://github.com/haikuports/haikuports/issues/3045)
Gerasim Troeglazov <3dEyes@gmail.com>
* Misc
----
* Improved safety when copying things into string buffers.
2020.April.24 (0.9.24)
* New tools
---------

File diff suppressed because it is too large Load diff