packets: fix use of potentially uninitialized value