From afbf81afc42b8bce9987fe1a0715cb2fe2199e0c Mon Sep 17 00:00:00 2001 From: orbisai0security Date: Mon, 15 Jun 2026 01:30:15 +0000 Subject: fix: V-002 security vulnerability Automated security fix generated by OrbisAI Security --- include/compat/dirent_msvc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/compat/dirent_msvc.h b/include/compat/dirent_msvc.h index 67f295f..e8a0956 100644 --- a/include/compat/dirent_msvc.h +++ b/include/compat/dirent_msvc.h @@ -165,7 +165,8 @@ _wopendir(const wchar_t *dirname) n = GetFullPathNameW(dirname, 0, NULL, NULL); /* Allocate room for absolute directory name and search pattern */ - dirp->patt =(wchar_t*) malloc(sizeof(wchar_t) * n + 16); + if (n <= (SIZE_MAX - 16) / sizeof(wchar_t)) + dirp->patt =(wchar_t*) malloc(sizeof(wchar_t) * n + 16); if (dirp->patt) { /* -- cgit v1.2.3-55-g6feb