From 30e81370b162e8ea611613e39e0e00241745ef82 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Sat, 27 May 2023 19:57:01 +0330 Subject: [PATCH] pg: fix early free when neatmail-source header is present Reported by Stefan . --- pg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pg.c b/pg.c index f874f40..392dd09 100644 --- a/pg.c +++ b/pg.c @@ -163,9 +163,9 @@ int pg(char *argv[]) if (source && (hdr = msg_get(msg, msglen, "Neatmail-Source:")) != NULL) { while (*hdr && *hdr != ' ') hdr++; - free(msg); if (sscanf(hdr, "%d@%s %ld %ld", &num, box, &beg, &end) != 4) return 1; + free(msg); if (mbox_off(box, beg, end, &msg, &msglen) != 0) return 1; } -- 2.11.4.GIT