asn1: don't increment a buffer beyond its end.

Bug: 15870
Change-Id: I04cbb822f0e77c8e0ac8513e3a5c13116920ca6e
Reviewed-on: https://code.wireshark.org/review/33731
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2019-06-24 23:36:15 +02:00 committed by Anders Broman
parent 68122d26b9
commit 45a3d0787f
1 changed files with 3 additions and 0 deletions

View File

@ -234,6 +234,9 @@ double asn1_get_real(const guint8 *real_ptr, gint len) {
DISSECTOR_ASSERT_NOT_REACHED();
}
/* Ensure the buffer len and its content are coherent */
DISSECTOR_ASSERT(lenE < len - 1);
Eneg = (*p) & 0x80 ? TRUE : FALSE;
for (i = 0; i < lenE; i++) {
if(Eneg) {