You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RecordConnector::glob(const std::string &pattern)
{
DBENTRY entry;
long status;
std::set<RecordConnector *> result;
dbInitEntry(pdbbase, &entry);
status = dbFirstRecordType(&entry);
while (!status) {
status = dbFirstRecord(&entry);
while (!status) {
//DEBUG
char * s;
status = dbFindField(&entry, "RTYP");
if( ! status) s= dbGetString(&entry);
printf("%ld: '%s'",status,s);
status = dbFindField(&entry, "DTYP");
if( ! status) s= dbGetString(&entry);
printf("%ld: '%s'",status,s);
//DEBUG END
if (!(dbFindField(&entry, "RTYP") || strcmp(dbGetString(&entry), "opcuaItem"))
|| !(dbFindField(&entry, "DTYP") || strcmp(dbGetString(&entry), "OPCUA"))) {
and found that the code segfaults when coming across a seq record.
That delivered the crucial hint:
The seq record has a DTYP field (in dbCommon) that is never set. dbFindField() finds it nevertheless. However, the code in dbGetEntry() will return NULL for DTYP (as the DTYP menu of the seq record has no choices).
Reported by @bkuner:
Description
Running
opcuaShow()
with a record name segfaults immediately.Steps to reproduce the behavior:
myRecord
connected to OPC UAopcuaShow("myRecord")
Setup:
The text was updated successfully, but these errors were encountered: