[ovs-dev] [PATCH] ofp-parse: Correctly update bucket lists if they are empty

Ben Pfaff blp at nicira.com
Fri Feb 13 22:48:49 UTC 2015


On Thu, Jan 29, 2015 at 07:48:38AM +0900, Simon Horman wrote:
> On Wed, Jan 28, 2015 at 11:33:05PM +0100, Thomas Graf wrote:
> > On 01/28/15 at 01:22pm, Ben Pfaff wrote:
> > > Are you sure?  What *gms points to, that is, **gms, is freed, but *gms
> > > should still point to the same location.  list_moved() never
> > > dereferences 'orig', only compares it against list->next.  In a very
> > > language-lawyer way, working with a pointer to freed memory may be
> > > technically "undefined behavior", but I don't know of bad effects in
> > > practice.
> > 
> > What Ben proposed is definitely fine. It's like a NULL check except
> > that NULL is not 0x0 but something else ;-)
> 
> Thanks, I also agree that Ben is correct and that my earlier analysis
> surrounding realloc was incorrect: I missed the distinction between
> *cms and **gms.
> 
> I now have no problems with Ben's solution and would be happy
> to see it merged.

I forgot about this patch, sorry.

Now applied to master, branch-2.3, branch-2.1.



More information about the dev mailing list