Ignore:
Timestamp:
Jun 25, 2014 12:58:19 AM (7 years ago)
Author:
ldelgass
Message:

Fix crash bug in user errors: was returning pointer to temporary. Return a
copy of string object from getUserMessages instead of pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/geovis/RendererCmd.cpp

    r4383 r4422  
    18521852    }
    18531853
    1854     string = getUserMessages();
    1855     nBytes = strlen(string);
     1854    std::string msg = getUserMessages();
     1855    nBytes = msg.length();
    18561856    if (nBytes > 0) {
     1857        string = msg.c_str();
    18571858        TRACE("userError=(%s)", string);
    18581859
    18591860        std::ostringstream oss;
    18601861        oss << "nv>viserror -type error -token " << g_stats.nCommands << " -bytes " << nBytes << "\n" << string;
    1861         nBytes = oss.str().length();
    1862 
    1863         if (queueResponse(oss.str().c_str(), nBytes, Response::VOLATILE, Response::ERROR) < 0) {
     1862        std::string ostr = oss.str();
     1863        nBytes = ostr.length();
     1864
     1865        if (queueResponse(ostr.c_str(), nBytes, Response::VOLATILE, Response::ERROR) < 0) {
    18641866            return -1;
    18651867        }
Note: See TracChangeset for help on using the changeset viewer.