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
This commit is contained in:
Solomon Peachy 2025-08-25 10:42:08 -04:00
parent 31939086af
commit 9e3bb65228

View file

@ -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);