1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

buffer: Do not call explicit_bzero with null arguments

This allows compiling and testing with undefined sanitizer.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Nikos Mavrogiannopoulos
2018-04-18 09:09:05 +02:00
committed by Andreas Schneider
parent eb796b4bbb
commit 3f562ee586

View File

@@ -195,7 +195,9 @@ static void buffer_shift(ssh_buffer buffer){
int ssh_buffer_reinit(struct ssh_buffer_struct *buffer)
{
buffer_verify(buffer);
explicit_bzero(buffer->data, buffer->used);
if (buffer->used > 0) {
explicit_bzero(buffer->data, buffer->used);
}
buffer->used = 0;
buffer->pos = 0;