From 3d412395246599bf633efd3ecd7f33c2bb97f66b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 10 Jan 2024 10:24:33 +0100 Subject: [PATCH] Fix use after free in androidvfs.c * src/androidvfs.c (android_afs_opendir, android_saf_tree_opendir): Fix use after free. --- src/androidvfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.2