diff options
author | Dario Lombardo <lomato@gmail.com> | 2019-06-25 11:05:08 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2019-06-25 11:37:23 +0000 |
commit | deb81bd99fbea012d9c10923c174e0b1b7284dea (patch) | |
tree | 1809dc28433d4b896d06d51becc65919a5268187 /epan/asn1.c | |
parent | dca6d36aab02edae7d81dace19b0e04858e300ee (diff) |
asn1: replace DISSECTOR_ASSERT_NOT_REACHED with DISSECTOR_ASSERT.
Change-Id: I5f7b870ada61c10397ecd6c1becf0087211252f7
Reviewed-on: https://code.wireshark.org/review/33734
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/asn1.c')
-rw-r--r-- | epan/asn1.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/epan/asn1.c b/epan/asn1.c index 1faef845ee..62e3b2a333 100644 --- a/epan/asn1.c +++ b/epan/asn1.c @@ -227,12 +227,10 @@ double asn1_get_real(const guint8 *real_ptr, gint len) { /* 8.5.6.4 Exponent length */ lenE = (octet & 0x3) + 1; - if(lenE == 4) - { - /* we can't handle exponents > 24 bits */ - /* TODO Next octet(s) define length of exponent */ - DISSECTOR_ASSERT_NOT_REACHED(); - } + + /* we can't handle exponents > 24 bits */ + /* TODO Next octet(s) define length of exponent */ + DISSECTOR_ASSERT(lenE != 4); /* Ensure the buffer len and its content are coherent */ DISSECTOR_ASSERT(lenE < len - 1); @@ -253,11 +251,10 @@ double asn1_get_real(const guint8 *real_ptr, gint len) { } lenN = len - lenE; - if(lenN > 8) - { - /* we can't handle integers > 64 bits */ - DISSECTOR_ASSERT_NOT_REACHED(); - } + + /* we can't handle integers > 64 bits */ + DISSECTOR_ASSERT(lenN <= 8); + for (i=0; i<lenN; i++) { N = (N<<8) | *p; p++; |