]> granicus.if.org Git - strace/commit
Introduce hardened xsprintf/xsnprintf macros
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 5 Jan 2018 01:18:05 +0000 (02:18 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 5 Jan 2018 12:26:47 +0000 (12:26 +0000)
commit0b92a3c9334f73cba85a6259adbf51c0d642ac3f
tree10f6c67b2f8e3c7de036c4d8fa4dd4e0606b75e6
parent94264b790e5289e10d8ddba3470a274e524c8e15
Introduce hardened xsprintf/xsnprintf macros

Let's try to future/fool-proof code a bit by introducing variants
of sprintf/snprintf that die if an overflow (or an error) occurs.
They are deemed to be the default choice for printing to some local
string buffer where no sensible error handling is implemented.

* xstring.h: New file.
* Makefile.am (strace_SOURCES): Add it.
Makefile.am
xstring.h [new file with mode: 0644]