ofproto-dpif: Avoid dereferencing possibly null or wild pointer.
authorBen Pfaff <blp@nicira.com>
Thu, 16 Aug 2012 18:33:21 +0000 (11:33 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 16 Aug 2012 23:13:21 +0000 (16:13 -0700)
commitdd30ff28ca73dfe20e0b0c0e7c58dba485ca0098
treeaa75146a1f8c88b1a09580b9929790991413b594
parentc2d967a562aaa57b679c302a5041d5a941154143
ofproto-dpif: Avoid dereferencing possibly null or wild pointer.

If ofpacts_len is 0 then ofpacts->type is a bad reference.

(An early draft of ofpacts used an OFPACT_END sentinel so that there was
always data there in this function, but in review the sentinel got deleted
and I did not notice that this function needed an update.)

Found by valgrind.

Bug #12847.
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif.c