Skip to content

Commit

Permalink
rest_client: prevent overflow in Content-Type
Browse files Browse the repository at this point in the history
(cherry picked from commit c92794e)
  • Loading branch information
razvancrainea committed Sep 26, 2018
1 parent 0685333 commit d72409d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/rest_client/rest_methods.c
Expand Up @@ -201,7 +201,7 @@ int start_async_http_req(struct sip_msg *msg, enum rest_client_method method,
w_curl_easy_setopt(handle, CURLOPT_POSTFIELDS, req_body);

if (req_ctype) {
sprintf(print_buff, "Content-Type: %s", req_ctype);
snprintf(print_buff, MAX_CONTENT_TYPE_LEN, "Content-Type: %s", req_ctype);
header_list = curl_slist_append(header_list, print_buff);
w_curl_easy_setopt(handle, CURLOPT_HTTPHEADER, header_list);
}
Expand Down Expand Up @@ -606,7 +606,7 @@ int rest_post_method(struct sip_msg *msg, char *url, char *body, char *ctype,
}

if (ctype) {
sprintf(print_buff, "Content-Type: %s", ctype);
snprintf(print_buff, MAX_CONTENT_TYPE_LEN, "Content-Type: %s", ctype);
header_list = curl_slist_append(header_list, print_buff);
}

Expand Down

0 comments on commit d72409d

Please sign in to comment.