In XmppMessageBuilder::GetData() don't return temporary stack variable address
In XmppMessageBuilder::GetData(), address of a string allocated in stack as
a temporary variable was returned to the caller in some case. This can cause
memory corruption because the the temporary string will get destroyed right
after it goes out of scope, in this case when we return to the caller from
GetData().
Fixed by ensuring that caller of GetData() provides the necessary temporary
storage space for the "temp" std::string
Reviewed: https:/ /review. opencontrail. org/41171 github. com/Juniper/ contrail- controller/ commit/ c9e40b1c9076a4e ccd8280aed1b814 ca65b1f805
Committed: http://
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master
commit c9e40b1c9076a4e ccd8280aed1b814 ca65b1f805
Author: Ananth Suryanarayana <email address hidden>
Date: Wed Mar 28 02:31:30 2018 -0700
In XmppMessageBuil der::GetData( ) don't return temporary stack variable address
In XmppMessageBuil der::GetData( ), address of a string allocated in stack as
a temporary variable was returned to the caller in some case. This can cause
memory corruption because the the temporary string will get destroyed right
after it goes out of scope, in this case when we return to the caller from
GetData().
Fixed by ensuring that caller of GetData() provides the necessary temporary
storage space for the "temp" std::string
Change-Id: I27e622a34b7271 7cad90dc9553936 182c2a77c6a
Closes-Bug: 1759744