Page MenuHomeFreeBSD

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

Authored by bnovkov on Tue, Jan 27, 3:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 4, 4:33 PM
Unknown Object (File)
Tue, Feb 3, 11:46 PM
Unknown Object (File)
Tue, Feb 3, 11:26 AM
Unknown Object (File)
Wed, Jan 28, 7:54 AM
Unknown Object (File)
Wed, Jan 28, 7:17 AM
Unknown Object (File)
Wed, Jan 28, 7:16 AM
Unknown Object (File)
Wed, Jan 28, 4:17 AM
Unknown Object (File)
Wed, Jan 28, 2:27 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