33 lines
967 B
Diff
33 lines
967 B
Diff
From 61eb4e487e00ed6758a62f07222488c5ec5fdb42 Mon Sep 17 00:00:00 2001
|
|
From: Jakub Jelen <jjelen@redhat.com>
|
|
Date: Mon, 30 Nov 2020 14:15:59 +0100
|
|
Subject: [PATCH] card: Correctly free pointers durint cache invalidation
|
|
|
|
As the whole structure is memset(0) on the following line,
|
|
we need to clean the pointers before doing so.
|
|
|
|
Thanks oss-fuzz
|
|
|
|
Related to:
|
|
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27797
|
|
---
|
|
src/libopensc/card.c | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/src/libopensc/card.c b/src/libopensc/card.c
|
|
index 0de8b7e..03c3cc8 100644
|
|
--- a/src/libopensc/card.c
|
|
+++ b/src/libopensc/card.c
|
|
@@ -1367,6 +1367,8 @@ scconf_block *sc_get_conf_block(sc_context_t *ctx, const char *name1, const char
|
|
void sc_invalidate_cache(struct sc_card *card)
|
|
{
|
|
if (card) {
|
|
+ sc_file_free(card->cache.current_ef);
|
|
+ sc_file_free(card->cache.current_df);
|
|
memset(&card->cache, 0, sizeof(card->cache));
|
|
card->cache.valid = 0;
|
|
}
|
|
--
|
|
1.8.3.1
|
|
|