File net-snmp-5.7.3-swintst_rpm-Protect-against-unspecified-Group-name.patch of Package net-snmp.9069

From 78a18abf05b755804a4f4403b8f26effbeafdc79 Mon Sep 17 00:00:00 2001
From: Niels Baggesen <nba@users.sourceforge.net>
Date: Tue, 23 May 2017 07:37:27 +0200
Subject: [PATCH] swintst_rpm: Protect against unspecified Group name. Fixes
 bug 2780.

---
 agent/mibgroup/host/data_access/swinst_rpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c
index dae8f6af8..fc97f2b4f 100644
--- a/agent/mibgroup/host/data_access/swinst_rpm.c
+++ b/agent/mibgroup/host/data_access/swinst_rpm.c
@@ -126,7 +126,7 @@ netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags)
                                       "%s-%s-%s", n, v, r);
         if (entry->swName_len > sizeof(entry->swName))
             entry->swName_len = sizeof(entry->swName);
-        entry->swType = (NULL != strstr( g, "System Environment"))
+        entry->swType = (g && NULL != strstr( g, "System Environment"))
                         ? 2      /* operatingSystem */
                         : 4;     /*  application    */
 
-- 
2.13.7
openSUSE Build Service is sponsored by