Fixes:
CVE-2015-1606: Use after free, resulting from failure to skip invalid packets
CVE-2015-1607: memcpy with overlapping ranges, resulting from incorrect
bitwise left shifts
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>