rpms/net-snmp/F-7 net-snmp-5.4-smux-password.patch, NONE, 1.1 net-snmp.spec, 1.115, 1.116

Jan Šafránek (jsafrane) fedora-extras-commits at redhat.com
Mon Oct 8 09:29:03 UTC 2007


Author: jsafrane

Update of /cvs/pkgs/rpms/net-snmp/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20007

Modified Files:
	net-snmp.spec 
Added Files:
	net-snmp-5.4-smux-password.patch 
Log Message:
fix segfault on parsing smuxpeer without password
Resolves: #316621

net-snmp-5.4-smux-password.patch:

--- NEW FILE net-snmp-5.4-smux-password.patch ---
Source: svn diff -r 15941:15942
Reviewed-By: Jan Safranek <jsafrane at redhat.com>

Index: agent/mibgroup/smux/smux.c
===================================================================
--- agent/mibgroup/smux/smux.c	(revision 15941)
+++ agent/mibgroup/smux/smux.c	(revision 15942)
@@ -150,42 +150,40 @@
 	config_perror("Too many smuxpeers");
 	return;
     }
-    aptr->sa_active_fd = -1;
-    if (!cptr) {
-        /*
-         * null passwords OK 
-         */
-        Auths[nauths++] = aptr;
-        DEBUGMSGTL(("smux_conf", "null password\n"));
-        return;
-    }
 
     /*
      * oid 
      */
-    password_cptr = strchr(cptr, ' ');
-    cptr_len = strlen(cptr);
-    if (password_cptr)
-        *password_cptr = 0x0;
-
+    aptr->sa_active_fd = -1;
     aptr->sa_oid_len = MAX_OID_LEN;
     read_objid( cptr, aptr->sa_oid, &aptr->sa_oid_len );
-
     DEBUGMSGTL(("smux_conf", "parsing registration for: %s\n", cptr));
 
-    if ((&password_cptr - &cptr + 1) < cptr_len) {
-        cptr = ++password_cptr;
-        DEBUGMSGTL(("smux_conf", "password is: %s\n",
-                    SNMP_STRORNULL(cptr)));
-    }
+    password_cptr = strchr(cptr, ' ');
+    cptr_len = strlen(cptr);
 
-    /*
-     * password 
-     */
-    if (cptr)
-        strcpy(aptr->sa_passwd, cptr);
+    if (password_cptr != NULL) {    /* Do we have a password or not? */
+        *password_cptr = 0x0;
+	if ((&password_cptr - &cptr + 1) < cptr_len) {
+	    cptr = ++password_cptr;
+	    DEBUGMSGTL(("smux_conf", "password is: %s\n",
+	                SNMP_STRORNULL(cptr)));
+	}
 
+        /*
+         * password 
+         */
+        if (cptr)
+            strcpy(aptr->sa_passwd, cptr);
+    } else {
+        /*
+         * null passwords OK 
+         */
+        DEBUGMSGTL(("smux_conf", "null password\n"));
+    }
+
     Auths[nauths++] = aptr;
+    return;
 }
 
 void


Index: net-snmp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/F-7/net-snmp.spec,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- net-snmp.spec	7 Aug 2007 07:57:42 -0000	1.115
+++ net-snmp.spec	8 Oct 2007 09:28:31 -0000	1.116
@@ -7,7 +7,7 @@
 Summary: A collection of SNMP protocol tools and libraries
 Name: net-snmp
 Version: %{major_ver}
-Release: 14%{?dist}
+Release: 15%{?dist}
 Epoch: 1
 
 License: MIT
@@ -43,6 +43,7 @@
 Patch19: net-snmp-5.3.1-shared-ip.patch
 Patch20: net-snmp-5.3.1-mib-option.patch
 Patch21: net-snmp-5.4-exec-crash.patch
+Patch22: net-snmp-5.4-smux-password.patch
 
 Requires(pre): /sbin/chkconfig
 Requires(post): /sbin/chkconfig
@@ -165,6 +166,7 @@
 %patch19 -p1 -b .shared-ip
 %patch20 -p1 -b .mib-option
 %patch21 -p1 -b .exec-crash
+%patch22 -p0 -b .smux-password
 
 # Do this patch with a perl hack...
 perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@@ -369,8 +371,9 @@
 %{_libdir}/lib*.so.*
 
 %changelog
-* Tue Aug  7 2007 Jan Safranek <jsafranek at redhat.com> 5.4-15
+* Mon Oct  8 2007 Jan Safranek <jsafranek at redhat.com> 5.4-15
 - License: field changed to MIT
+- fix segfault on parsing smuxpeer without password (#316621)
 
 * Thu Jun 28 2007 Jan Safranek <jsafranek at redhat.com> 5.4-14
 - fix snmptrapd hostname logging (#238587)




More information about the fedora-extras-commits mailing list