Comment 3 for bug 1759744

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/41171
Committed: http://github.com/Juniper/contrail-controller/commit/c9e40b1c9076a4eccd8280aed1b814ca65b1f805
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit c9e40b1c9076a4eccd8280aed1b814ca65b1f805
Author: Ananth Suryanarayana <email address hidden>
Date: Wed Mar 28 02:31:30 2018 -0700

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

Change-Id: I27e622a34b72717cad90dc9553936182c2a77c6a
Closes-Bug: 1759744