diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-02-17 14:48:16 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-02-17 22:48:53 +0000 |
commit | 04704e289fbc0b06dc1352da8416488425650cc2 (patch) | |
tree | b145ae9222f431f1c6b502ed4faaac6b1dd17c44 /epan/dissectors/packet-umts_fp.c | |
parent | 137da3f1064c89c98cdd9fe66a707a7d3fe05e00 (diff) |
Don't gratuitously cast away constness.
Change-Id: I778deaaee1d52c4a5a716f6d23f787e041664deb
Reviewed-on: https://code.wireshark.org/review/25853
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-umts_fp.c')
-rw-r--r-- | epan/dissectors/packet-umts_fp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c index 6d2186b0ab..6283b39b7e 100644 --- a/epan/dissectors/packet-umts_fp.c +++ b/epan/dissectors/packet-umts_fp.c @@ -3891,14 +3891,14 @@ check_header_crc_for_heur(tvbuff_t *tvb, guint16 header_length) { guint8 crc = 0; guint8 calc_crc = 0; - guint8 * data = NULL; + const guint8 * data = NULL; if (header_length > tvb_captured_length(tvb)) return FALSE; crc = tvb_get_guint8(tvb, 0) >> 1; /* Get data of header excluding the first byte */ - data = (guint8 *)tvb_get_ptr(tvb, 1, header_length - 1); + data = tvb_get_ptr(tvb, 1, header_length - 1); calc_crc = crc7update(0, data, header_length - 1); calc_crc = crc7finalize(calc_crc); @@ -3916,7 +3916,7 @@ check_payload_crc_for_heur(tvbuff_t *tvb, guint16 header_length) guint16 calc_crc = 0; guint16 payload_index; guint16 payload_length; - guint8 *data = NULL; + const guint8 *data = NULL; reported_length = tvb_reported_length(tvb); if (reported_length < 2 || reported_length > tvb_captured_length(tvb)) { @@ -3928,7 +3928,7 @@ check_payload_crc_for_heur(tvbuff_t *tvb, guint16 header_length) payload_index = header_length; /* payload first index is the same as the header length */ payload_length = (reported_length - payload_index) - 2; - data = (guint8 *)tvb_get_ptr(tvb, payload_index, payload_length); + data = tvb_get_ptr(tvb, payload_index, payload_length); calc_crc = crc16_8005_noreflect_noxor(data, payload_length); return calc_crc == crc; @@ -3946,12 +3946,12 @@ generate_ue_id_for_heur(packet_info *pinfo) /* srcXor: [ ------- Source Address ------- ] (4 bytes)*/ /* XOR */ /* [ Source Port ][ Source Port ] (4 bytes)*/ - int srcXor = *((guint32*)pinfo->src.data) ^ ((pinfo->srcport << 16) | (pinfo->srcport)); + int srcXor = *((const guint32*)pinfo->src.data) ^ ((pinfo->srcport << 16) | (pinfo->srcport)); /* dstXor: [ ---- Destination Address ---- ] (4 bytes)*/ /* XOR */ /* [ - Dest Port - ][ - Dest Port - ] (4 bytes)*/ - int dstXor = *((guint32*)pinfo->dst.data) ^ ((pinfo->destport << 16) | (pinfo->destport)); + int dstXor = *((const guint32*)pinfo->dst.data) ^ ((pinfo->destport << 16) | (pinfo->destport)); return srcXor ^ dstXor; } else { |