commit 9b84fd8c3d885f9d0b2e8ac90e901d89e0208a0c
parent 13c6d440f646ce7fd1030169249f785a9390a48d
Author: wwp <subscript@free.fr>
Date: Wed, 6 Oct 2021 09:16:14 +0200
Fix CID 1492328: uninitialized ptr read (bound to fix for CID 1491222).
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/msgcache.c b/src/msgcache.c
@@ -331,6 +331,7 @@ gint msgcache_get_memory_usage(MsgCache *cache)
GET_CACHE_DATA_INT(tmp_len); \
if (rem_len < tmp_len) { \
g_print("error at rem_len:%d (tmp_len %d)\n", rem_len, tmp_len); \
+ procmsg_msginfo_free(&msginfo); \
error = TRUE; \
goto bail_err; \
} \
@@ -663,9 +664,10 @@ MsgCache *msgcache_read_cache(FolderItem *item, const gchar *cache_file)
char *walk_data = cache_data+ftell(fp);
while(rem_len > 0) {
- GET_CACHE_DATA_INT(num);
-
msginfo = procmsg_msginfo_new();
+
+ GET_CACHE_DATA_INT(num);
+
msginfo->msgnum = num;
memusage += sizeof(MsgInfo);