diff options
| author | Jakob Kaivo <jkk@ung.org> | 2024-01-31 13:24:56 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2024-01-31 13:24:56 -0500 |
| commit | 4b43b375b7abae22070cd86bfc26a8222233150e (patch) | |
| tree | 6ff165b17879e80300cb6d05b5537a65c82c2dc7 /src/stdlib/getenv_s.c | |
| parent | ab3c589cd14c2b7efd79c89fd75ea35edcf9edff (diff) | |
check for overlapping pointers
Diffstat (limited to 'src/stdlib/getenv_s.c')
| -rw-r--r-- | src/stdlib/getenv_s.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stdlib/getenv_s.c b/src/stdlib/getenv_s.c index 73e6131c..489bdeea 100644 --- a/src/stdlib/getenv_s.c +++ b/src/stdlib/getenv_s.c @@ -1,11 +1,16 @@ #include <string.h> #include <stdlib.h> +#include <string.h> #include "_stdlib.h" /** get an environment variable **/ errno_t getenv_s(size_t * restrict len, char * restrict value, rsize_t maxsize, const char * restrict name) { SIGNAL_SAFE(0); + ASSERT_NOOVERLAP(len, sizeof(*len), value, maxsize); + ASSERT_NOOVERLAP(len, sizeof(*len), name, strlen(name)); + ASSERT_NOOVERLAP(value, maxsize, name, strlen(name)); + (void)len; (void)value; (void)maxsize; (void)name; return 0; } |
