Skip to content

Instantly share code, notes, and snippets.

@guidovranken
Created September 1, 2018 18:49
Show Gist options
  • Select an option

  • Save guidovranken/3ca4ce4c56f0b50d7b6e0094a6a2c1a6 to your computer and use it in GitHub Desktop.

Select an option

Save guidovranken/3ca4ce4c56f0b50d7b6e0094a6a2c1a6 to your computer and use it in GitHub Desktop.
diff --git a/contrib/bsnmp/lib/asn1.c b/contrib/bsnmp/lib/asn1.c
index 03b5662..57f9380 100644
--- a/contrib/bsnmp/lib/asn1.c
+++ b/contrib/bsnmp/lib/asn1.c
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_len_t *len)
*len = *b->asn_cptr++;
b->asn_len--;
}
+
+ if ( *len > b->asn_len ) {
+ return (ASN_ERR_EOBUF);
+ }
+
return (ASN_ERR_OK);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment