Bug 1024958 - HotRodClientException.what() returns dangling pointer
Summary: HotRodClientException.what() returns dangling pointer
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: CPP Client
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER5
: 6.2.0
Assignee: Tristan Tarrant
QA Contact: Alan Field
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-30 16:11 UTC by Radim Vansa
Modified: 2023-04-01 08:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker HRCPP-56 0 Major Closed HotRodClientException.what() returns dangling pointer 2013-12-10 13:26:23 UTC

Description Radim Vansa 2013-10-30 16:11:23 UTC
The what() method returns c_str() from string allocated on stack (via stringstream). By the time what() returns, the stack is already unwinded.

You have to initialize some string as the exception's field and only return the c_str() from this field.

This may lead to client app crash.


Note You need to log in before you can comment on or make changes to this bug.