aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/ess
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-04-30 20:03:39 -0700
committerGuy Harris <guy@alum.mit.edu>2015-05-01 06:50:36 +0000
commitb84972635117aa5cac7f8e6296d07ceb51bfe5e2 (patch)
tree89f3c0baff68f63dcadb737de9e4da3c2b97bdfc /asn1/ess
parent91515a008143901473e018033a76933abfec3c1f (diff)
Fix some cases where we're shifting a signed 1 left.
Shift 1U instead, to make sure it's unsigned; the result of, for example, the result of shifting a signed value left is undefined if the value times 2^{shift count} doesn't fit in the *signed* type of the shifted value. That means, in particular, that the result of shifting 1 left by {number of bits in an int - 1} is undefined. (In *practice*, it'll probably be -2^32, with the bit you want set, but that's not guaranteed, and GCC 5.1 seems not to like it.) Make some other left-hand operands of <<, and some variables holding results from shifts of that sort, unsigned, while we're at it. Change-Id: Ie72a9d0d518f59b35948267d10c80735d162e8bb Reviewed-on: https://code.wireshark.org/review/8264 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'asn1/ess')
-rw-r--r--asn1/ess/packet-ess-template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/asn1/ess/packet-ess-template.c b/asn1/ess/packet-ess-template.c
index 23a6854c8f..b9c20eb7c1 100644
--- a/asn1/ess/packet-ess-template.c
+++ b/asn1/ess/packet-ess-template.c
@@ -126,7 +126,7 @@ ess_dissect_attribute_flags (tvbuff_t *tvb, asn1_ctx_t *actx)
if ((strcmp (u->oid, object_identifier_id) == 0) &&
((u->lacv / 8) < tvb_captured_length (tvb)) &&
- (value[u->lacv / 8] & (1 << (7 - (u->lacv % 8)))))
+ (value[u->lacv / 8] & (1U << (7 - (u->lacv % 8)))))
{
proto_tree_add_string_format (tree, hf_ess_Category_attribute, tvb,
u->lacv / 8, 1, u->name,