Welcome! Log In Create A New Profile

Advanced

early ngx_memcpy() with NGX_MEMCPY_LIMIT patch

Vladimir Shebordaev
July 30, 2012 02:26PM
Hi,

ngx_memcpy() is invoked before ngx_cycle has been initialized, so the server
can segfault there when NGX_MEMCPY_LIMIT is enabled.

diff -Naur rev4754/src/core/ngx_string.c ticket55/src/core/ngx_string.c
--- rev4754/src/core/ngx_string.c 2012-07-16 23:15:16.613980918 +0400
+++ ticket55/src/core/ngx_string.c 2012-07-23 15:41:02.863561192 +0400
@@ -1830,7 +1830,8 @@
ngx_memcpy(void *dst, void *src, size_t n)
{
if (n > NGX_MEMCPY_LIMIT) {
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "memcpy %uz bytes", n);
+ if (ngx_cycle)
+ ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, "memcpy
%uz bytes", n);
ngx_debug_point();
}


--
Regards,
Vladimir

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

early ngx_memcpy() with NGX_MEMCPY_LIMIT patch

Vladimir Shebordaev 1344 July 30, 2012 02:26PM

Re: early ngx_memcpy() with NGX_MEMCPY_LIMIT patch

Maxim Dounin 439 July 30, 2012 06:04PM

Re: early ngx_memcpy() with NGX_MEMCPY_LIMIT patch

Vladimir Shebordaev 521 July 30, 2012 06:22PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 313
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready