diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-07-09 07:03:01 +0200 |
---|---|---|
committer | Sven Eden <sven.eden@prydeworx.com> | 2018-10-29 10:18:27 +0100 |
commit | 081232081ccb96d2361834625caba4d3d2341437 (patch) | |
tree | 7f115420e77b9bb903a9f0e640d39020865a87e2 /src/basic/stat-util.c | |
parent | 4ac4caa2cf2ee617c1b9b53246aa07cb8bf54154 (diff) |
Introduce free_and_strndup and use it in bus-message.c
v2: fix error in free_and_strndup()
When the orignal and copied message were the same, but shorter than specified
length l, memory read past the end of the buffer would be performed. A test
case is included: a string that had an embedded NUL ("q\0") is used to replace
"q".
v3: Fix one more bug in free_and_strndup and add tests.
v4: Some style fixed based on review, one more use of free_and_replace, and
make the tests more comprehensive.
(cherry picked from commit 7f546026abbdc56c453a577e52d57159458c3e9c)
Diffstat (limited to 'src/basic/stat-util.c')
0 files changed, 0 insertions, 0 deletions