From 429bceda74c007bde07af0dd831896644b5fc7e7 Mon Sep 17 00:00:00 2001 From: OrbisAI Security Date: Mon, 15 Jun 2026 10:16:59 +0530 Subject: fix: address code review feedback on SIZE_MAX and errno - Include to ensure SIZE_MAX is defined for MSVC - Set errno to ENOMEM when malloc fails for better error reporting Addresses review comments: - https://github.com/libressl/portable/pull/1304#discussion_r3411021522 - https://github.com/libressl/portable/pull/1304#discussion_r3411041707 Co-Authored-By: Claude Sonnet 4.5 --- include/compat/dirent_msvc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/compat/dirent_msvc.h b/include/compat/dirent_msvc.h index e8a0956..0f36803 100644 --- a/include/compat/dirent_msvc.h +++ b/include/compat/dirent_msvc.h @@ -47,6 +47,7 @@ #include #include +#include /* Indicates that d_type field is available in dirent structure */ #define _DIRENT_HAVE_D_TYPE @@ -215,6 +216,7 @@ _wopendir(const wchar_t *dirname) } else { /* Cannot allocate memory for search pattern */ + _set_errno(ENOMEM); error = 1; } -- cgit v1.2.3-55-g6feb