git: libc/rs: Fix use-after-free on realloc (-Wuse-after-free).

Matthew Dillon dillon at crater.dragonflybsd.org
Fri May 22 18:43:41 PDT 2026


commit 572db2bcd8e779a0361743ab4524edc4eb319640
Author: Abdelkader Boudih <dragonflybsd at seuros.com>
Date:   Thu May 22 07:49:01 2025 +0000

    libc/rs: Fix use-after-free on realloc (-Wuse-after-free).
    
    GCC 15 warns when pointer arithmetic references a pointer that was
    passed to realloc(). Save the offset before the realloc call and
    recompute the pointer from the new allocation afterwards.

Summary of changes:
 lib/libc/gen/setmode.c | 6 +++---
 usr.bin/rs/rs.c        | 8 +++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/572db2bcd8e779a0361743ab4524edc4eb319640


-- 
DragonFly BSD source repository


More information about the Commits mailing list