From: Stefan Kangas Date: Wed, 10 Jan 2024 09:24:33 +0000 (+0100) Subject: Fix use after free in androidvfs.c X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3d412395246599bf633efd3ecd7f33c2bb97f66b;p=emacs.git Fix use after free in androidvfs.c * src/androidvfs.c (android_afs_opendir, android_saf_tree_opendir): Fix use after free. --- diff --git a/src/androidvfs.c b/src/androidvfs.c index 3377683c84f..78f6b6da6a8 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -2388,8 +2388,8 @@ android_afs_opendir (struct android_vnode *vnode) and as such can be exactly one byte past directory_tree. */ if (dir->asset_limit > directory_tree + directory_tree_size) { - xfree (dir); xfree (dir->asset_file); + xfree (dir); errno = EACCES; return NULL; } @@ -5547,8 +5547,8 @@ android_saf_tree_opendir (struct android_vnode *vnode) if (!cursor) { - xfree (dir); xfree (dir->name); + xfree (dir); return NULL; }