Skip to content
Permalink
Browse files

Revert "fix gcc8 warnings"

This reverts commit 097a1e9.
  • Loading branch information...
buixor committed Nov 23, 2018
1 parent 097a1e9 commit a82a6e59b7b71854c27ae16fbf0f6b8edeac9b16
Showing with 6 additions and 11 deletions.
  1. +2 −2 naxsi_src/naxsi_runtime.c
  2. +0 −5 naxsi_src/naxsi_skeleton.c
  3. +4 −4 naxsi_src/naxsi_utils.c
@@ -733,10 +733,10 @@ ngx_http_dummy_is_rule_whitelisted_n(ngx_http_request_t *req,
tmp_hashname.data = ngx_pcalloc(req->pool, tmp_hashname.len+2);
if (target_name) {
tmp_hashname.len++;
strcat((char*)tmp_hashname.data, "#");
strncat((char*)tmp_hashname.data, "#", 1);
}
strncat((char*) tmp_hashname.data, (char*)req->uri.data, req->uri.len);
strcat((char*)tmp_hashname.data, "#");
strncat((char*)tmp_hashname.data, "#", 1);
strncat((char*)tmp_hashname.data, (char*)name->data, name->len);

NX_DEBUG(_debug_whitelist_compat, NGX_LOG_DEBUG_HTTP, req->connection->log, 0, "hashing MIX [%V] ($URL:x|$X_VAR:y) or ($URL:x|$X_VAR:y|NAME)", &tmp_hashname);
@@ -414,13 +414,8 @@ ngx_http_dummy_init(ngx_conf_t *cf)
libjct_sql->sc_tag->data = ngx_pcalloc(cf->pool, 18 /* LIBINJECTION_SQL */);
libjct_xss->sc_tag->data = ngx_pcalloc(cf->pool, 18 /* LIBINJECTION_XSS */);
if (!libjct_sql->sc_tag->data || !libjct_xss->sc_tag->data) return (NGX_ERROR); /* LCOV_EXCL_LINE */
/* avoid stringop-truncation false positive.
nginx_str_t is not null terminated */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy((char *)libjct_sql->sc_tag->data, (char *)"$LIBINJECTION_SQL", 17);
strncpy((char *)libjct_xss->sc_tag->data, (char *)"$LIBINJECTION_XSS", 17);
#pragma GCC diagnostic pop
libjct_xss->sc_tag->len = 17;
libjct_sql->sc_tag->len = 17;
libjct_sql->sc_score = 8;
@@ -455,11 +455,11 @@ ngx_http_wlr_find(ngx_conf_t *cf, ngx_http_dummy_loc_conf_t *dlc,
"whitelist targets |NAME");


strcat(*fullname, (const char *) "#");
strncat(*fullname, (const char *) "#", 1);
}
strncat(*fullname, (const char *) custloc_array(curr->br->custom_locations->elts)[uri_idx].target.data,
custloc_array(curr->br->custom_locations->elts)[uri_idx].target.len);
strcat(*fullname, (const char *) "#");
strncat(*fullname, (const char *) "#", 1);
strncat(*fullname, (const char *) custloc_array(curr->br->custom_locations->elts)[name_idx].target.data,
custloc_array(curr->br->custom_locations->elts)[name_idx].target.len);
}
@@ -477,7 +477,7 @@ ngx_http_wlr_find(ngx_conf_t *cf, ngx_http_dummy_loc_conf_t *dlc,
"whitelist targets |NAME");


strcat(*fullname, (const char *) "#");
strncat(*fullname, (const char *) "#", 1);
}


@@ -492,7 +492,7 @@ ngx_http_wlr_find(ngx_conf_t *cf, ngx_http_dummy_loc_conf_t *dlc,

*fullname = ngx_pcalloc(cf->pool, custloc_array(curr->br->custom_locations->elts)[name_idx].target.len + 2);
if (curr->br->target_name)
strcat(*fullname, (const char *) "#");
strncat(*fullname, (const char *) "#", 1);
strncat(*fullname, (const char *) custloc_array(curr->br->custom_locations->elts)[name_idx].target.data,
custloc_array(curr->br->custom_locations->elts)[name_idx].target.len);
}

0 comments on commit a82a6e5

Please sign in to comment.
You can’t perform that action at this time.