[ 
https://issues.apache.org/jira/browse/GEODE-2484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15870896#comment-15870896
 ] 

ASF GitHub Bot commented on GEODE-2484:
---------------------------------------

Github user dgkimura commented on a diff in the pull request:

    https://github.com/apache/geode-native/pull/15#discussion_r101655637
  
    --- Diff: src/cppcache/src/TcrMessage.hpp ---
    @@ -1113,12 +1117,11 @@ class TcrMessageHelper {
           return NULL_OBJECT;
         } else if (!isObj) {
           // otherwise we're currently always expecting an object
    -      char exMsg[256];
    -      std::snprintf(exMsg, 255,
    -                    "TcrMessageHelper::readChunkPartHeader: "
    -                    "%s: part is not object",
    -                    methodName);
    -      LOGDEBUG("%s ", exMsg);
    +
    +      std::stringstream s;
    +      s << "TcrMessageHelper::readChunkPartHeader: " << methodName << ": 
part is not object\n";
    +      LOGDEBUG("%s ", s.str().c_str());
    --- End diff --
    
    I find this line a little suspicious.  If I understand correctly, 
`stringstream.str()` will return a temporary string object and then `c_str()` 
will return a pointer to that temporary object.  Then it seems like it may be 
possible that temporary string is freed after the expression is evaluated.  And 
then we would be referencing a freed object inside `LOGDEBUG` which would lead 
to undefined behavior.  If I am misunderstanding then please educate me how 
this works and why you chose to do it!  :)


> Remove ACE from native client dependencies
> ------------------------------------------
>
>                 Key: GEODE-2484
>                 URL: https://issues.apache.org/jira/browse/GEODE-2484
>             Project: Geode
>          Issue Type: Task
>          Components: native client
>            Reporter: David Kimura
>
> Remove ACE from native client dependencies.
> Replace ACE usage with C++11 and/or Boost 1.63+



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to