mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 04:08:01 +02:00
shared/strbuf: only clear the bytes that we actually wrote to
The allocated buffes are not known to be written. It is unnecessary to clear them. If the user writes sensitive data to those locations, without using the NMStrBuf API, then it is up to the user to bzero the memory accordingly.
This commit is contained in:
parent
d1c2572e11
commit
abacc1e919
1 changed files with 1 additions and 1 deletions
|
|
@ -194,7 +194,7 @@ nm_str_buf_destroy (NMStrBuf *strbuf)
|
|||
return;
|
||||
_nm_str_buf_assert (strbuf);
|
||||
if (strbuf->_do_bzero_mem)
|
||||
nm_explicit_bzero (strbuf->_str, strbuf->_allocated);
|
||||
nm_explicit_bzero (strbuf->_str, strbuf->_len);
|
||||
g_free (strbuf->_str);
|
||||
|
||||
/* the buffer is in invalid state afterwards, however, we clear it
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue