The following reply was made to PR system/6468; it has been noted by GNATS.
From: =?iso-8859-1?Q?R=E9mi?= Laurent <remi.laur...@conostix.com> To: Martin Hedenfalk <mar...@bzero.se> Cc: gn...@cvs.openbsd.org, b...@cvs.openbsd.org Subject: Re: system/6468: snmpd segfault when receiving a GET request on an hrStorage table Date: Mon, 20 Sep 2010 09:44:46 +0200 * Martin Hedenfalk - 17-09-2010 ` 00h29: > Hi Remi, > > Attached is an alternative diff that tries to fix this for all > tables. Ok, it works well, and also works with other tables, single value or snmpwalk style with getnext. > Does this fix the issue as well? > > -martin > > > Index: snmpd/mps.c > =================================================================== > RCS file: /cvs/src/usr.sbin/snmpd/mps.c,v > retrieving revision 1.13 > diff -u -p -u -r1.13 mps.c > --- snmpd/mps.c 18 Jan 2008 21:55:42 -0000 1.13 > +++ snmpd/mps.c 14 Jun 2010 15:10:31 -0000 > @@ -134,9 +134,13 @@ mps_getreq(struct ber_element *root, str > &value->o_id, value->o_oidlen + 1); > if (value->o_get == NULL) > elm = ber_add_null(elm); > - else > + else { > + if ((value->o_flags & OID_TABLE) == OID_TABLE && > + o->bo_n <= value->o_oidlen) > + return (NULL); > if (value->o_get(value, o, &elm) != 0) > return (NULL); > + } > > return (elm); > } -- Rimi Laurent Phone: +352 26 10 30 61 General Support: supp...@conostix.com GPG FP: 27F4 6810 2B0E 1AA0 CDAE 7C7B 3DC9 085A 0FA0 0601