epan: access a ws_in4_addr byte by byte.

Fixes a regression introduced by d3c4dfa9ee.
It changed the type of the function, but not the way we access it. The
former code proceeded byte by byte, and we need to keep that behavior.

Bug: 16497
Change-Id: I02983635d7cf8e44a5631bf64d4a2854cb9c3bdb
Reviewed-on: https://code.wireshark.org/review/36858
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
This commit is contained in:
Dario Lombardo 2020-04-16 17:41:08 +02:00 committed by Guy Harris
parent 251b16bb93
commit 6d25a1062d
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ tvb_get_ipv4_addr_with_prefix_len(tvbuff_t *tvb, int offset, ws_in4_addr *addr,
*addr = 0;
tvb_memcpy(tvb, addr, offset, addr_len);
if (prefix_len % 8)
addr[addr_len - 1] &= ((0xff00 >> (prefix_len % 8)) & 0xff);
((guint8*)addr)[addr_len - 1] &= ((0xff00 >> (prefix_len % 8)) & 0xff);
return addr_len;
}