From 801710b8c7569f7d275e5c7bd5d6ce46a79cfdc0 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Tue, 9 Jun 2020 11:50:11 +0200 Subject: [PATCH] db: fix possible null pointer dereference (found by sonar/cppcheck) --- src/ioc/db/recGbl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ioc/db/recGbl.c b/src/ioc/db/recGbl.c index 6406b3773..29b7c19ed 100644 --- a/src/ioc/db/recGbl.c +++ b/src/ioc/db/recGbl.c @@ -67,7 +67,7 @@ void recGblDbaddrError(long status, const struct dbAddr *paddr, errPrintf(status,0,0, "PV: %s.%s " "error detected in routine: %s\n", - (paddr ? precord->name : "Unknown"), + (precord ? precord->name : "Unknown"), (pdbFldDes ? pdbFldDes->name : ""), (pmessage ? pmessage : "Unknown")); return; @@ -104,7 +104,7 @@ void recGblRecSupError(long status, const struct dbAddr *paddr, " %s\n", (psupport_name ? psupport_name : "Unknown"), (pdbRecordType ? pdbRecordType->name : "Unknown"), - (paddr ? precord->name : "Unknown"), + (precord ? precord->name : "Unknown"), (pdbFldDes ? pdbFldDes->name : ""), (pmessage ? pmessage : "")); return;