There are some missing checks before performing comparing check between packet headers, the GRE magic and tunnel id.
Bad constructed packet with headers shorter than 8 bytes for EoIP may introduce comparison of memory which are out of current buffered packet and owned by previous packets.