check sizeof(*packet). Found by PVS-Studio