aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-per.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2012-08-14 22:12:31 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2012-08-14 22:12:31 +0000
commitd34ca4d69db158fb8c361a3dbe9a3760a4498d1b (patch)
tree3ffe04297092ecd2357e4602da3de81c21a8d31a /epan/dissectors/packet-per.c
parent03a9a378636d34610d32f50b2b798947aaaf5ecf (diff)
From Jan de Jongh via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7624 :
dissect_per_constrained_integer_64b fails for 64 bits svn path=/trunk/; revision=44510
Diffstat (limited to 'epan/dissectors/packet-per.c')
-rw-r--r--epan/dissectors/packet-per.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index e7a989ed5d..c1bee28045 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -1302,7 +1302,8 @@ DEBUG_ENTRY("dissect_per_constrained_integer");
}
actx->created_item = it;
if (value) *value = val;
- return offset;}
+ return offset;
+}
guint32
dissect_per_constrained_integer_64b(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, guint64 min, guint64 max, guint64 *value, gboolean has_extension)
@@ -1333,14 +1334,14 @@ DEBUG_ENTRY("dissect_per_constrained_integer_64b");
* d) "range" is greater than 64K (the indefinite length case).
*/
if(((max-min)>65536)&&(actx->aligned)){
- /* just set range really big so it will fall through
- to the bottom of the encoding */
- /* range=1000000; */
- range = max-min;
- if (range==65536)
- range++; /* make it fall trough? */
+ /* just set range really big so it will fall through
+ to the bottom of the encoding */
+ /* range=1000000; */
+ range = max-min;
+ if (range==65536)
+ range++; /* make it fall trough? */
} else {
- /* Copied from the 32 bit version, asuming the same problem occures
+ /* Copied from the 32 bit version, assuming the same problem occurs
* at 64 bit boundary.
* Really ugly hack.
* We should really use guint64 as parameters for min/max.
@@ -1375,11 +1376,11 @@ DEBUG_ENTRY("dissect_per_constrained_integer_64b");
*/
char *str;
int i, bit, length;
- guint32 mask,mask2;
- /* We only handle 32 bit integers */
- mask = 0x80000000;
- mask2 = 0x7fffffff;
- i = 32;
+ guint64 mask,mask2;
+ /* We only handle 64 bit integers */
+ mask = G_GINT64_CONSTANT(0x8000000000000000);
+ mask2 = G_GINT64_CONSTANT(0x7fffffffffffffff);
+ i = 64;
while ((range & mask)== 0){
i = i - 1;
mask = mask>>1;