From 9e3bb652287df13a7b8f3049cf8c4ed2f0a05d4b Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 25 Aug 2025 10:42:08 -0400 Subject: [PATCH] database: Validate paths against MAX_PATH as well as TAX_MAXLEN TAG_MAXLEN is 2* MAX_PATH, so this means we don't reject paths that we could never actually open on the device. Change-Id: I64363758163c0a6a5f54ebb1c9b455f3cb5b6e56 --- apps/tagcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tagcache.c b/apps/tagcache.c index 5224d53c02..4657fce205 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -2255,7 +2255,7 @@ static void NO_INLINE add_tagcache(char *path, unsigned long mtime) return ; /* Check for overlength file path. */ - if (path_length > TAG_MAXLEN) + if (path_length > MAX_PATH || path_length > TAG_MAXLEN) { /* Path can't be shortened. */ logf("Too long path: %s", path);