git: 6d2a147ae558 - main - libedit: fix use after free
- Reply: Shawn Webb : "Re: git: 6d2a147ae558 - main - libedit: fix use after free"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 05 Mar 2026 16:13:25 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/src/commit/?id=6d2a147ae558ef423e3df451a9049200b291a8d0
commit 6d2a147ae558ef423e3df451a9049200b291a8d0
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-03-05 16:12:51 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-03-05 16:13:08 +0000
libedit: fix use after free
---
contrib/libedit/map.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/libedit/map.c b/contrib/libedit/map.c
index e45b819c0be0..6e08d647a980 100644
--- a/contrib/libedit/map.c
+++ b/contrib/libedit/map.c
@@ -962,12 +962,12 @@ map_end(EditLine *el)
el->el_map.emacs = NULL;
el->el_map.vic = NULL;
el->el_map.vii = NULL;
- el_free(el->el_map.help);
- el->el_map.help = NULL;
for (size_t nf = EL_NUM_FCNS; nf < el->el_map.nfunc; nf++) {
el_free((void *)(intptr_t)el->el_map.help[nf].name);
el_free((void *)(intptr_t)el->el_map.help[nf].description);
}
+ el_free(el->el_map.help);
+ el->el_map.help = NULL;
el_free(el->el_map.func);
el->el_map.func = NULL;
}