diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/nginx.h | 4 | ||||
-rw-r--r-- | src/core/ngx_conf_file.h | 2 | ||||
-rw-r--r-- | src/core/ngx_connection.c | 2 | ||||
-rw-r--r-- | src/core/ngx_file.c | 2 | ||||
-rw-r--r-- | src/core/ngx_inet.c | 19 | ||||
-rw-r--r-- | src/core/ngx_murmurhash.h | 2 | ||||
-rw-r--r-- | src/core/ngx_rbtree.c | 3 | ||||
-rw-r--r-- | src/core/ngx_times.c | 4 |
8 files changed, 20 insertions, 18 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h index f23bbf4d0..3e147dcb7 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1001018 -#define NGINX_VERSION "1.1.18" +#define nginx_version 1001019 +#define NGINX_VERSION "1.1.19" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h index e92668cd4..4b87f1aad 100644 --- a/src/core/ngx_conf_file.h +++ b/src/core/ngx_conf_file.h @@ -14,7 +14,7 @@ /* - * AAAA number of agruments + * AAAA number of arguments * FF command flags * TT command type, i.e. HTTP "location" or "server" command */ diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index 4d1aa0d1b..ba1b3f9e2 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -708,7 +708,7 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle) /* * it seems that Linux-2.6.x OpenVZ sends events * for closed shared listening sockets unless - * the events was explicity deleted + * the events was explicitly deleted */ ngx_del_event(c->read, NGX_READ_EVENT, 0); diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c index ce3a0a282..d9b30f844 100644 --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -808,7 +808,7 @@ failed: * reallocated if ctx->alloc is nonzero * * ctx->alloc - a size of data structure that is allocated at every level - * and is initilialized by ctx->init_handler() + * and is initialized by ctx->init_handler() * * ctx->log - a log * diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index 2785c8c8c..d2bbbfb58 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -44,11 +44,7 @@ ngx_inet_addr(u_char *text, size_t len) return INADDR_NONE; } - if (n != 3) { - return INADDR_NONE; - } - - if (octet < 256) { + if (n == 3 && octet < 256) { addr = (addr << 8) + octet; return htonl(addr); } @@ -407,6 +403,10 @@ ngx_ptocidr(ngx_str_t *text, ngx_cidr_t *cidr) #if (NGX_HAVE_INET6) case AF_INET6: + if (shift > 128) { + return NGX_ERROR; + } + addr = cidr->u.in6.addr.s6_addr; mask = cidr->u.in6.mask.s6_addr; rc = NGX_OK; @@ -416,7 +416,7 @@ ngx_ptocidr(ngx_str_t *text, ngx_cidr_t *cidr) s = (shift > 8) ? 8 : shift; shift -= s; - mask[i] = (u_char) (0 - (1 << (8 - s))); + mask[i] = (u_char) (0xffu << (8 - s)); if (addr[i] != (addr[i] & mask[i])) { rc = NGX_DONE; @@ -428,9 +428,12 @@ ngx_ptocidr(ngx_str_t *text, ngx_cidr_t *cidr) #endif default: /* AF_INET */ + if (shift > 32) { + return NGX_ERROR; + } if (shift) { - cidr->u.in.mask = htonl((ngx_uint_t) (0 - (1 << (32 - shift)))); + cidr->u.in.mask = htonl((uint32_t) (0xffffffffu << (32 - shift))); } else { /* x86 compilers use a shl instruction that shifts by modulo 32 */ @@ -459,7 +462,7 @@ ngx_parse_addr(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text, size_t len) struct sockaddr_in6 *sin6; /* - * prevent MSVC8 waring: + * prevent MSVC8 warning: * potentially uninitialized local variable 'inaddr6' used */ ngx_memzero(inaddr6.s6_addr, sizeof(struct in6_addr)); diff --git a/src/core/ngx_murmurhash.h b/src/core/ngx_murmurhash.h index 2b2b70d6c..54e867d30 100644 --- a/src/core/ngx_murmurhash.h +++ b/src/core/ngx_murmurhash.h @@ -16,4 +16,4 @@ uint32_t ngx_murmur_hash2(u_char *data, size_t len); -#endif /* _NGX_CRC_H_INCLUDED_ */ +#endif /* _NGX_MURMURHASH_H_INCLUDED_ */ diff --git a/src/core/ngx_rbtree.c b/src/core/ngx_rbtree.c index 6ae4d5c05..914ca7e88 100644 --- a/src/core/ngx_rbtree.c +++ b/src/core/ngx_rbtree.c @@ -136,8 +136,7 @@ ngx_rbtree_insert_timer_value(ngx_rbtree_node_t *temp, ngx_rbtree_node_t *node, /* node->key < temp->key */ - p = ((ngx_rbtree_key_int_t) node->key - (ngx_rbtree_key_int_t) temp->key - < 0) + p = ((ngx_rbtree_key_int_t) (node->key - temp->key) < 0) ? &temp->left : &temp->right; if (*p == sentinel) { diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c index 6a5808fe2..ed1bf64bc 100644 --- a/src/core/ngx_times.c +++ b/src/core/ngx_times.c @@ -33,7 +33,7 @@ volatile ngx_str_t ngx_cached_http_log_iso8601; #if !(NGX_WIN32) /* - * locatime() and localtime_r() are not Async-Signal-Safe functions, therefore, + * localtime() and localtime_r() are not Async-Signal-Safe functions, therefore, * they must not be called by a signal handler, so we use the cached * GMT offset value. Fortunately the value is changed only two times a year. */ @@ -308,7 +308,7 @@ ngx_gmtime(time_t t, ngx_tm_t *tp) /* * The "days" should be adjusted to 1 only, however, some March 1st's go * to previous year, so we adjust them to 2. This causes also shift of the - * last Feburary days to next year, but we catch the case when "yday" + * last February days to next year, but we catch the case when "yday" * becomes negative. */ |