git: catopen(3): Fix race condition
Aaron LI
aly at crater.dragonflybsd.org
Mon Oct 5 06:32:14 PDT 2026
commit 7c8d516d0d1c77beaa4a93b1bc45a1178180e469
Author: Aaron LI <aly at aaronly.me>
Date: Mon Oct 5 20:44:06 2026 +0800
catopen(3): Fix race condition
The current code uses a rwlock to protect the cached list, which
in turn holds a list of catentry objects, and increments reference
count while holding only read lock. Fix this by converting the
reference counter to use atomic operations.
Also improve the cleanups of memory allocations.
Obtained-from: FreeBSD (commit 4188ba1a3b65b4a55fc938b71d9091fafb57967d)
Reported-by: pmjdebruijn
Bug: https://bugs.dragonflybsd.org/issues/3393
Summary of changes:
lib/libc/nls/msgcat.c | 59 +++++++++++++++++++++++++++++++++------------------
1 file changed, 38 insertions(+), 21 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7c8d516d0d1c77beaa4a93b1bc45a1178180e469
--
DragonFly BSD source repository
More information about the Commits
mailing list