diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2018-11-15 21:28:02 +0300 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2018-11-15 21:28:02 +0300 |
| commit | 6c3838f9ed45f5c2aa6a971a0da3cb6ffe45b61e (patch) | |
| tree | 2fea4ab11c5cf1e16fe5f085f70890acf12fb7ea /src/core | |
| parent | 841c899a9e376b1ec4147e9aa4afba10a8269abc (diff) | |
| download | nginx-6c3838f9ed45f5c2aa6a971a0da3cb6ffe45b61e.tar.gz nginx-6c3838f9ed45f5c2aa6a971a0da3cb6ffe45b61e.tar.bz2 | |
Core: ngx_explicit_memzero().
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/ngx_string.c | 8 | ||||
| -rw-r--r-- | src/core/ngx_string.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index 2ee07bfc8..04980f8c3 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -2013,6 +2013,14 @@ ngx_sort(void *base, size_t n, size_t size, } +void +ngx_explicit_memzero(void *buf, size_t n) +{ + ngx_memzero(buf, n); + ngx_memory_barrier(); +} + + #if (NGX_MEMCPY_LIMIT) void * diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h index 882ae7cea..0fb9be72e 100644 --- a/src/core/ngx_string.h +++ b/src/core/ngx_string.h @@ -88,6 +88,8 @@ ngx_strlchr(u_char *p, u_char *last, u_char c) #define ngx_memzero(buf, n) (void) memset(buf, 0, n) #define ngx_memset(buf, c, n) (void) memset(buf, c, n) +void ngx_explicit_memzero(void *buf, size_t n); + #if (NGX_MEMCPY_LIMIT) |
