Commit 65be7160 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

make sure buffer string is initialized correctly

parent ae7f0730
......@@ -3981,8 +3981,10 @@ transaction_request_cb (pjsip_rx_data *rdata)
if (rdata->msg_info.msg->body) {
char sdpbuffer[1000];
rdata->msg_info.msg->body->print_body (rdata->msg_info.msg->body, sdpbuffer, 1000);
std::string sdpoffer = std::string (sdpbuffer);
int len = rdata->msg_info.msg->body->print_body (rdata->msg_info.msg->body, sdpbuffer, 1000);
if (len == -1) // error
len = 0;
std::string sdpoffer = std::string (sdpbuffer, len);
size_t start = sdpoffer.find ("a=crypto:");
// Found crypto header in SDP
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment