diff options
| author | OrbisAI Security <mediratta01.pally@gmail.com> | 2026-06-15 10:16:59 +0530 |
|---|---|---|
| committer | OrbisAI Security <mediratta01.pally@gmail.com> | 2026-06-15 10:16:59 +0530 |
| commit | 429bceda74c007bde07af0dd831896644b5fc7e7 (patch) | |
| tree | 418acb7802d11751300e5d5f6cb53064debff964 | |
| parent | afbf81afc42b8bce9987fe1a0715cb2fe2199e0c (diff) | |
| download | portable-429bceda74c007bde07af0dd831896644b5fc7e7.tar.gz portable-429bceda74c007bde07af0dd831896644b5fc7e7.tar.bz2 portable-429bceda74c007bde07af0dd831896644b5fc7e7.zip | |
fix: address code review feedback on SIZE_MAX and errno
- Include <stdint.h> 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 <noreply@anthropic.com>
| -rw-r--r-- | include/compat/dirent_msvc.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 @@ | |||
| 47 | 47 | ||
| 48 | #include <stdarg.h> | 48 | #include <stdarg.h> |
| 49 | #include <sys/stat.h> | 49 | #include <sys/stat.h> |
| 50 | #include <stdint.h> | ||
| 50 | 51 | ||
| 51 | /* Indicates that d_type field is available in dirent structure */ | 52 | /* Indicates that d_type field is available in dirent structure */ |
| 52 | #define _DIRENT_HAVE_D_TYPE | 53 | #define _DIRENT_HAVE_D_TYPE |
| @@ -215,6 +216,7 @@ _wopendir(const wchar_t *dirname) | |||
| 215 | 216 | ||
| 216 | } else { | 217 | } else { |
| 217 | /* Cannot allocate memory for search pattern */ | 218 | /* Cannot allocate memory for search pattern */ |
| 219 | _set_errno(ENOMEM); | ||
| 218 | error = 1; | 220 | error = 1; |
| 219 | } | 221 | } |
| 220 | 222 | ||
