From 30b3056e570c6c5f14a0a1023b4c8b4f4e740e3c Mon Sep 17 00:00:00 2001 From: Rajeev Katta Date: Tue, 2 Dec 2025 06:35:09 -0500 Subject: [PATCH] rbus: fixup null returns in getEventTableInstNum Coverity issue ID: 85 (line 1337) Fix generated by RDKDevPilot AI Bot Co-authored-by: rdkdevpilot --- test/rbus/provider/rbusTestProvider.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/rbus/provider/rbusTestProvider.c b/test/rbus/provider/rbusTestProvider.c index 0cf5f495..467b6ede 100644 --- a/test/rbus/provider/rbusTestProvider.c +++ b/test/rbus/provider/rbusTestProvider.c @@ -1333,7 +1333,14 @@ int getEventTableInstNum(char const* propName) { int instNum = 0; char buff[2] = {0}; - char const* pinstNum = strstr(propName, "EventsTable.") + 12; + char const* pinstNum = strstr(propName, "EventsTable."); + + if(!pinstNum) { + printf("%s: EventsTable not found in %s\n", __FUNCTION__, propName); + return 0; // Return default value + } + + pinstNum += 12; // Move past "EventsTable." buff[0] = *pinstNum; instNum = atoi(buff); printf("%s %s instNum=%d\n", __FUNCTION__, propName, instNum);