git: net/radix: Fix rn_refines() and add the function description

Aaron LI aly at crater.dragonflybsd.org
Tue Sep 19 17:08:47 PDT 2023


commit f9879abee72316f27fd56d919ee3efa84a3d4a9f
Author: Aaron LI <aly at aaronly.me>
Date:   Sat Jun 17 09:36:39 2023 +0800

    net/radix: Fix rn_refines() and add the function description
    
    After 'n++' called in the 'longer' assignment, the clen(n) becomes
    invalid since the first byte is no longer the key length.  This caused
    the function to always return FALSE and could lead to out-of-bound
    memory access.
    
    Fix the bug, and describe the function's usage and return value.
    
    The bug was introduced in commit 2e9572d in 2004.
    
    Reported-by: dczheng

Summary of changes:
 sys/net/radix.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f9879abee72316f27fd56d919ee3efa84a3d4a9f


-- 
DragonFly BSD source repository


More information about the Commits mailing list