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:
parent
56591258ff
commit
e50a0ef84c
2 changed files with 212 additions and 173 deletions
|
|
@ -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
|
||||
---------
|
||||
|
|
|
|||
381
src/tuxpaint.c
381
src/tuxpaint.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue