epics-base / pvaClientCPP

pvaClientCPP is an EPICS V4 C++ module
http://epics-pvdata.sourceforge.net/index.html
Other
2 stars 8 forks source link

PvaClientData::parse bug #62

Closed mrkraimer closed 4 years ago

mrkraimer commented 5 years ago

If the caller requests a field that does not exist then a crash occurs. The following is a fix that will be pushes shortly.

     git diff src/pvaClientData.cpp
     diff --git a/src/pvaClientData.cpp b/src/pvaClientData.cpp
    index b503732..56b3e7a 100644
    --- a/src/pvaClientData.cpp
    +++ b/src/pvaClientData.cpp
    @@ -433,6 +433,7 @@ void PvaClientData::parse(const std::vector<std::string> &args)
                continue;
             } 
             PVFieldPtr pvField(pvStructure->getSubField(field));
    +        if(!pvField) throw std::runtime_error(messagePrefix + field +" does not exist");
            // look for enumerated structure
             PVEnumerated pvEnumerated;
             bool result = pvEnumerated.attach(pvField);
mrkraimer commented 5 years ago

This bug has been fixed.

mrkraimer commented 4 years ago

This change was made