coturn / coturn/coturn

Access to field 'fd' results in a dereference of a null pointer (loaded from variable 'clnet_info_rtcp') [clang-analyzer-core.NullDereference]

Open
#1,404 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
14.4k
Forks
2.3k
Avg merge
1d 15h
Merged PRs (30d)
24

Description

```
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:998:28: warning: Access to field 'fd' results in a dereference of a null pointer (loaded from variable 'clnet_info_rtcp') [clang-analyzer-core.NullDereference]
socket_set_nonblocking(clnet_info_rtcp->fd);
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1319:7: note: Assuming 'mclient' is >= 1
if (mclient < 1)
^~~~~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1319:3: note: Taking false branch
if (mclient < 1)
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1324:7: note: Assuming 'c2c' is 0
if (c2c) {
^~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1324:3: note: Taking false branch
if (c2c) {
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1331:9: note: Assuming 'no_rtcp' is not equal to 0
if (!no_rtcp)
^~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1331:5: note: Taking false branch
if (!no_rtcp)
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1348:7: note: Assuming 'c2c' is 0
if (c2c) {
^~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1348:3: note: Taking false branch
if (c2c) {
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1368:9: note: Assuming 'no_rtcp' is not equal to 0
if (!no_rtcp)
^~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1368:5: note: Taking false branch
if (!no_rtcp)
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1378:19: note: 'i' is < 'mclient'
for (i = 0; i < mclient; i++) {
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1378:7: note: Loop condition is true. Entering loop body
for (i = 0; i < mclient; i++) {
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1379:13: note: Assuming 'dos' is not equal to 0
if (!dos)
^~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1379:9: note: Taking false branch
if (!dos)
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:1381:13: note: Calling 'start_client'
if (start_client(remote_address, port, ifname, local_address, messagenumber, i) < 0) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:968:8: note: 'no_rtcp' is not equal to 0
if (!no_rtcp)
^~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:968:3: note: Taking false branch
if (!no_rtcp)
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:976:3: note: 'clnet_info_rtcp' initialized to a null pointer value
app_ur_conn_info *clnet_info_rtcp = NULL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:978:8: note: 'no_rtcp' is not equal to 0
if (!no_rtcp)
^~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:978:3: note: Taking false branch
if (!no_rtcp)
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:987:7: note: Assuming field 'ssl' is null
if (clnet_info_probe.ssl) {
^~~~~~~~~~~~~~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:987:3: note: Taking false branch
if (clnet_info_probe.ssl) {
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:990:14: note: Assuming the condition is false
} else if (clnet_info_probe.fd != -1) {
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:990:10: note: Taking false branch
} else if (clnet_info_probe.fd != -1) {
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:997:7: note: Assuming 'no_rtcp' is 0
if (!no_rtcp)
^~~~~~~~
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:997:3: note: Taking true branch
if (!no_rtcp)
^
/home/runner/work/coturn/coturn/src/apps/uclient/uclient.c:998:28: note: Access to field 'fd' results in a dereference of a null pointer (loaded from variable 'clnet_info_rtcp')
socket_set_nonblocking(clnet_info_rtcp->fd);
^~~~~~~~~~~~~~~
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.