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:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user