talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit ac14ec50d655c16fd6813526fd18d57d0f0e18ef
parent 62f60f91dfa86cdcba57aa8b6a7463b14e9bcebc
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:
Msrc/msgcache.c | 6++++--
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);