NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/39684: RB_REMOVE trashes link to tree, when requested to remove object that isn't in tree



>Number:         39684
>Category:       lib
>Synopsis:       RB_REMOVE trashes link to tree, when requested to remove 
>object that isn't in tree
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 03 14:10:00 +0000 2008
>Originator:     Lehtonen, Matti
>Release:        --
>Organization:
Helsinki Institute for Information Technology HIIT
>Environment:
/*      $NetBSD: tree.h,v 1.16 2008/03/21 13:07:15 ad Exp $     */
/*      $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $    */
>Description:
RB_REMOVE trashes root of tree (set to NULL), when requested to remove object 
that isn't in tree.

I would expect that "nothing" is done, when removing object that isn't in tree, 
instead of losing the whole tree.
>How-To-Repeat:
Try to remove an object from [populated] tree that isn't actually inserted 
there.
>Fix:
Make sure that object exists (by e.g. RB_INSERT() or RB_FIND() ) in tree, 
before remove operation.



Home | Main Index | Thread Index | Old Index