svn commit: r350637 - stable/12/contrib/bsnmp/lib

Ed Maste emaste at FreeBSD.org
Tue Aug 6 16:11:17 UTC 2019


Author: emaste
Date: Tue Aug  6 16:11:16 2019
New Revision: 350637
URL: https://svnweb.freebsd.org/changeset/base/350637

Log:
  MFC r350635: bsnmp: add asn1 message length validation
  
  admbugs:	780
  Submitted by:	Guido Vranken, bz
  Reported by:	Guido Vranken
  Approved by:	so
  Security:       CVE-2019-5610

Modified:
  stable/12/contrib/bsnmp/lib/asn1.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/bsnmp/lib/asn1.c
==============================================================================
--- stable/12/contrib/bsnmp/lib/asn1.c	Tue Aug  6 16:11:00 2019	(r350636)
+++ stable/12/contrib/bsnmp/lib/asn1.c	Tue Aug  6 16:11:16 2019	(r350637)
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le
 		*len = *b->asn_cptr++;
 		b->asn_len--;
 	}
+	if (*len > b->asn_len) {
+		asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
+		return (ASN_ERR_EOBUF);
+	}
+	
 	return (ASN_ERR_OK);
 }
 


More information about the svn-src-all mailing list