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

strncat() warnings on alpine #497

Merged
merged 1 commit into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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