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

Commit

Permalink
strncpy() instead of strcpy() on fixed buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
residuum committed Mar 24, 2015
1 parent eed01ff commit 7d87295
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/oauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void oauth_command(t_oauth *const oauth, const t_symbol *const sel, const int ar

oauth->common.locked = 1;
req_type = sel->s_name;
strcpy(oauth->common.req_type, req_type);
strncpy(oauth->common.req_type, req_type, REQUEST_TYPE_LEN - 1);
if (ctw_check_request_type(oauth->common.req_type) != 0){
pd_error(oauth, "Request method %s not supported.", oauth->common.req_type);
oauth->common.locked = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/rest.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void rest_command(t_rest *const rest, const t_symbol *const sel, const int argc,
}

rest->common.locked = 1;
strcpy(rest->common.req_type, req_type);
strncpy(rest->common.req_type, req_type, REQUEST_TYPE_LEN - 1);
if (ctw_check_request_type(rest->common.req_type) != 0){
pd_error(rest, "Request method %s not supported.", rest->common.req_type);
rest->common.locked = 0;
Expand Down

0 comments on commit 7d87295

Please sign in to comment.