Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 1fe5c00

Browse files
committed
Ensure "wrap" variable is non-NULL
RUNTIME_CHECK on the "wrap" variable avoids possible NULL dereference: thread.c: In function 'thread_wrap': thread.c:60:15: error: dereference of possibly-NULL 'wrap' [CWE-690] [-Werror=analyzer-possible-null-dereference] 60 | *wrap = (struct thread_wrap){ The RUNTIME_CHECK was there before 7d1ceaf.
1 parent 896cf63 commit 1fe5c00

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/isc/thread.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct thread_wrap {
5757
static struct thread_wrap *
5858
thread_wrap(isc_threadfunc_t func, void *arg) {
5959
struct thread_wrap *wrap = malloc(sizeof(*wrap));
60+
RUNTIME_CHECK(wrap != NULL);
6061
*wrap = (struct thread_wrap){
6162
.func = func,
6263
.arg = arg,

0 commit comments

Comments
 (0)