On Wed, Dec 14, 2011 at 05:50:39PM -0800, Ansis Atteka wrote: > On Thu, Dec 8, 2011 at 2:01 PM, Ben Pfaff <b...@nicira.com> wrote: > > +const char * > > +eth_from_hex(const char *hex, struct ofpbuf **packetp) > > +{ > > + struct ofpbuf *packet; > > + > > + packet = *packetp = ofpbuf_new(strlen(hex) / 2); > > > I did not try to apply and test this patch, but it seems that if > strlen(hex) == 1 (either valid or invalid hex digit), > then packet->base==NULL after the previous line.
Yes, but that should be OK. I don't see any code that would try to dereference packet->base in that case. > For example later ofpbuf_delete() could try to do free(NULL)... free(NULL) has been well-defined to do nothing for decades. We depend on that behavior elsewhere. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev