Project

General

Profile

Bug #5044

potential null pointer dereferences

Added by laforge about 2 months ago.

Status:
New
Priority:
Low
Assignee:
Category:
-
Target version:
-
Start date:
02/24/2021
Due date:
% Done:

0%

Spec Reference:

Description

gcc on OpenSUSE_Factory warns as follows:

[   69s]   CCLD     osmo-mgw
[   70s] ../libosmo-mgcp/mgcp_osmux.c: In function 'osmux_conn_lookup.constprop':
[   70s] ../libosmo-mgcp/mgcp_osmux.c:218:23: warning: potential null pointer dereference [-Wnull-dereference]
[   70s]   218 |  for (i = 0; i < trunk->number_endpoints; i++) {
[   70s]       |                       ^
[   70s] ../libosmo-mgcp/mgcp_osmux.c:218:23: warning: potential null pointer dereference [-Wnull-dereference]
[   70s] ../libosmo-mgcp/mgcp_vty.c: In function 'cfg_mgcp_omit_rtcp':
[   70s] ../libosmo-mgcp/mgcp_vty.c:782:19: warning: potential null pointer dereference [-Wnull-dereference]
[   70s]   782 |  trunk->omit_rtcp = 1;
[   70s]       |                   ^
[   70s] ../libosmo-mgcp/mgcp_vty.c:782:19: warning: potential null pointer dereference [-Wnull-dereference]
[   73s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/src/osmo-mgw'
[   73s] make[3]: Entering directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/src'
[   73s] make[3]: Nothing to be done for 'all-am'.
[   73s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/src'
[   73s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/src'
[   73s] Making all in tests
[   73s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/tests'
[   73s] Making all in mgcp_client
[   73s] make[3]: Entering directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/tests/mgcp_client'
[   74s]   CC       mgcp_client_test.o
[   74s]   CCLD     mgcp_client_test
[   75s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/tests/mgcp_client'
[   75s] Making all in mgcp
[   75s] make[3]: Entering directory '/home/abuild/rpmbuild/BUILD/osmo-mgw-1.8.1/tests/mgcp'
[   75s]   CC       mgcp_test.o
[   76s]   CCLD     mgcp_test
[   77s] mgcp_test.c: In function 'test_packet_loss_calc':
[   77s] mgcp_test.c:1074:21: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1074 |   packets_rx = &conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR];
[   77s]       |                     ^
[   77s] mgcp_test.c:1076:28: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1076 |   state->stats.initialized = 1;
[   77s]       |                            ^
[   77s] mgcp_test.c:1077:25: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1077 |   state->stats.base_seq = pl_test_dat[i].base_seq;
[   77s]       |                         ^
[   77s] mgcp_test.c:1078:24: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1078 |   state->stats.max_seq = pl_test_dat[i].max_seq;
[   77s]       |                        ^
[   77s] mgcp_test.c:1079:23: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1079 |   state->stats.cycles = pl_test_dat[i].cycles;
[   77s]       |                       ^
[   77s] mgcp_test.c:1074:21: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1074 |   packets_rx = &conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR];
[   77s]       |                     ^
[   77s] mgcp_test.c:1076:28: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1076 |   state->stats.initialized = 1;
[   77s]       |                            ^
[   77s] mgcp_test.c:1077:25: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1077 |   state->stats.base_seq = pl_test_dat[i].base_seq;
[   77s]       |                         ^
[   77s] mgcp_test.c:1078:24: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1078 |   state->stats.max_seq = pl_test_dat[i].max_seq;
[   77s]       |                        ^
[   77s] mgcp_test.c:1079:23: warning: potential null pointer dereference [-Wnull-dereference]
[   77s]  1079 |   state->stats.cycles = pl_test_dat[i].cycles;
[   77s]       |                       ^
[   78s] ../../src/libosmo-mgcp/mgcp_osmux.c: In function 'osmux_conn_lookup.constprop':
[   78s] ../../src/libosmo-mgcp/mgcp_osmux.c:218:23: warning: potential null pointer dereference [-Wnull-dereference]
[   78s]   218 |  for (i = 0; i < trunk->number_endpoints; i++) {
[   78s]       |                       ^
[   78s] ../../src/libosmo-mgcp/mgcp_osmux.c:218:23: warning: potential null pointer dereference [-Wnull-dereference]

we should check if there's any truth to it.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)