writeExecutePacket: fix capacity check