Add some more checks, clean up length handling.
authorGuy Harris <guy@alum.mit.edu>
Mon, 2 May 2016 00:58:49 +0000 (17:58 -0700)
committerGuy Harris <guy@alum.mit.edu>
Mon, 2 May 2016 00:59:19 +0000 (00:59 +0000)
commitc7d67d8ff5d799f49b83d54b0dfeb0a23618bbf1
tree45cd0d70b6418b98386c2e2913c904e09ca1ffe2
parent6332c2f45e5f0b23893a41def45384911f28109a
Add some more checks, clean up length handling.

Check for destination or source MAC addresses that aren't 12 characters
(hex dump of 6 octets) long and type/length fields that aren't 4
characters (hex dump of 2 octets) long.

The buffer into which we copy the hex dump characters doesn't need to be
null-terminated, so don't bother to null-terminate it.  Use the final
offset into the buffer as the buffer length, rather than using strlen().

Just memcpy the MAC addresses and type/length fields into the buffer;
the buffer is guaranteed to be big enough for all of them, and, as
noted, it doesn't need to be null-terminated.

Change-Id: I790e953542ae8443af01c81229a8deb877448ee3
Reviewed-on: https://code.wireshark.org/review/15239
Reviewed-by: Guy Harris <guy@alum.mit.edu>
wiretap/iseries.c