fix potential null pointer deref when packets are forged