]> git.kaiwu.me - nginx.git/commitdiff
test binary geo range base size
authorIgor Sysoev <igor@sysoev.ru>
Wed, 30 Jun 2010 10:13:51 +0000 (10:13 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 30 Jun 2010 10:13:51 +0000 (10:13 +0000)
src/http/modules/ngx_http_geo_module.c

index 0b511359c773a12c2744e31e38a9c8f1afff3130..1f3f75561b5e03db222508bc6c52f7d49da04966 100644 (file)
@@ -1232,7 +1232,7 @@ ngx_http_geo_include_binary_base(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
 
     header = (ngx_http_geo_header_t *) base;
 
-    if (ngx_memcmp(&ngx_http_geo_header, header, 12) != 0) {
+    if (size < 16 || ngx_memcmp(&ngx_http_geo_header, header, 12) != 0) {
         ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
              "incompatible binary geo range base \"%s\"", name->data);
         goto failed;