Page MenuHomeFreeBSD

btree/bt_seq.c: Fix two NULL pointer dereferences
ClosedPublic

Authored by bnovkov on Jan 27 2026, 3:35 PM.
Tags
None
Referenced Files
F159513800: D54905.id170527.diff
Mon, Jun 15, 3:56 AM
Unknown Object (File)
Fri, May 29, 4:30 PM
Unknown Object (File)
Thu, May 28, 1:26 PM
Unknown Object (File)
Thu, May 28, 6:19 AM
Unknown Object (File)
Mon, May 25, 11:20 AM
Unknown Object (File)
Mon, May 18, 12:18 PM
Unknown Object (File)
Mon, May 18, 12:10 PM
Unknown Object (File)
May 16 2026, 5:18 AM
Subscribers

Details

Summary

This change fixes two NULL pointer dereferences caused by the
__bt_first function.

The first was caused by returning 0 (i.e., RET_SUCCESS) when a key
was not found, causing the caller to dereference an uninitalized
or NULL pointer. The second one was caused by an if statment clobbering
a local variable with a function call result that might be NULL.

Reported by: clang-tidy
Sponsored by; Klara, Inc.
Obtained from: https://github.com/apple-oss-distributions/libc (partially)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70159
Build 67042: arc lint + arc unit