1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-10 06:23:01 +03:00

string: Correctly burn the string buffer.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
This commit is contained in:
Andreas Schneider
2014-09-15 18:28:15 +02:00
parent 93c7b81b4e
commit 1ddb99c46f

View File

@@ -235,10 +235,11 @@ struct ssh_string_struct *ssh_string_copy(struct ssh_string_struct *s) {
* @param[in] s The string to burn.
*/
void ssh_string_burn(struct ssh_string_struct *s) {
if (s == NULL) {
return;
}
memset(s->data, 'X', ssh_string_len(s));
if (s == NULL || s->size == 0) {
return;
}
BURN_BUFFER(s->data, ssh_string_len(s));
}
/**