Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
strncat() warnings on alpine (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinguy authored Jun 15, 2020
1 parent da216ca commit 40d91e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions naxsi_src/naxsi_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,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++;
strncat((char*)tmp_hashname.data, "#", 1);
strcat((char*)tmp_hashname.data, "#");
}
strncat((char*) tmp_hashname.data, (char*)req->uri.data, req->uri.len);
strncat((char*)tmp_hashname.data, "#", 1);
strcat((char*)tmp_hashname.data, "#");
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);
Expand Down
8 changes: 4 additions & 4 deletions naxsi_src/naxsi_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,11 @@ ngx_http_wlr_find(ngx_conf_t *cf, ngx_http_dummy_loc_conf_t *dlc,
"whitelist targets |NAME");


strncat(*fullname, (const char *) "#", 1);
strcat(*fullname, (const char *) "#");
}
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);
strncat(*fullname, (const char *) "#", 1);
strcat(*fullname, (const char *) "#");
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);
}
Expand All @@ -452,7 +452,7 @@ ngx_http_wlr_find(ngx_conf_t *cf, ngx_http_dummy_loc_conf_t *dlc,
"whitelist targets |NAME");


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


Expand All @@ -467,7 +467,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)
strncat(*fullname, (const char *) "#", 1);
strcat(*fullname, (const char *) "#");
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);
}
Expand Down

0 comments on commit 40d91e2

Please sign in to comment.