HomeFreeBSD

Fix misuse of input argument in traverse_visitbp

Description

Fix misuse of input argument in traverse_visitbp

In traverse_visitbp(), the input argument dnp is modified in the middle to
point to a temporary buffer. Originally this doesn't matter, because no user
of TRAVERSE_POST dereferences it. However, in fbeddd6 a piece of code is added
dereferencing dnp after the modification, creating a possible bug.

We fix this by creating a new local variable cdnp for the DMU_OT_DNODE case,
so we don't modify the input argument. Also we introduce different local
variables in the DMU_OT_OBJSET case to prevent confusion between the input
argument.

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2060

Details

Provenance
tuxoko <tuxoko@gmail.com>Authored on Apr 26 2015, 8:09 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Apr 28 2015, 4:43 PM
Parents
rG52d5a1cc5782: Merge branch 'zed-pushbullet'
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGecfb0b5f42c3: Fix misuse of input argument in traverse_visitbp (authored by tuxoko <tuxoko@gmail.com>).Apr 28 2015, 4:43 PM