The last argument to ast_copy_string() is the buffer size, not the
number of characters, so we add 1 to avoid stamping out the final \n
in the persisted SUBSCRIBE message.
Change-Id: I019b78942836f57965299af15d173911fcead5b2
|| type == SUBSCRIPTION_PERSISTENCE_RECREATED) {
if (rdata->msg_info.msg_buf) {
ast_copy_string(sub_tree->persistence->packet, rdata->msg_info.msg_buf,
- MIN(sizeof(sub_tree->persistence->packet), rdata->msg_info.len));
+ MIN(sizeof(sub_tree->persistence->packet), rdata->msg_info.len + 1));
} else {
ast_copy_string(sub_tree->persistence->packet, rdata->pkt_info.packet,
sizeof(sub_tree->persistence->packet));