when freeing a bitmap, zero all it bytes; spotted by Ilya Kaliman
authordjm <djm@openbsd.org>
Mon, 1 May 2017 22:09:48 +0000 (22:09 +0000)
committerdjm <djm@openbsd.org>
Mon, 1 May 2017 22:09:48 +0000 (22:09 +0000)
usr.bin/ssh/bitmap.c

index b9df2c9..776a01e 100644 (file)
@@ -51,8 +51,9 @@ void
 bitmap_free(struct bitmap *b)
 {
        if (b != NULL && b->d != NULL) {
-               explicit_bzero(b->d, b->len);
+               bitmap_zero(b);
                free(b->d);
+               b->d = NULL;
        }
        free(b);
 }