neels has uploaded this change for review.

View Change

fix warnings: 'uninitialized'

Though these can never be used uninitialized, initialize to NULL to
avoid compiler warnings like:

pfcp_msg.c:188:66: warning: 'h_no_seid' may be used uninitialized

Change-Id: Icb338b200fe3186ccd7fd3f502c1723f60947190
---
M src/libosmo-gtlv/gtlv_dec_enc.c
M src/libosmo-pfcp/pfcp_msg.c
2 files changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-pfcp refs/changes/54/29054/1
diff --git a/src/libosmo-gtlv/gtlv_dec_enc.c b/src/libosmo-gtlv/gtlv_dec_enc.c
index 2e5509a..c3e45ea 100644
--- a/src/libosmo-gtlv/gtlv_dec_enc.c
+++ b/src/libosmo-gtlv/gtlv_dec_enc.c
@@ -71,7 +71,7 @@
{
void *obj = MEMB(decoded_struct, obj_ofs);
const struct osmo_gtlv_coding *iec;
- unsigned int *multi_count_p;
+ unsigned int *multi_count_p = NULL;

/* To check for presence of mandatory IEs, need to keep a flag stack of seen ie_coding entries. This array has
* to have at least the nr of entries that the ie_coding array has. Let's allow up to this many ie_coding
diff --git a/src/libosmo-pfcp/pfcp_msg.c b/src/libosmo-pfcp/pfcp_msg.c
index 5f55575..098ffa2 100644
--- a/src/libosmo-pfcp/pfcp_msg.c
+++ b/src/libosmo-pfcp/pfcp_msg.c
@@ -158,8 +158,8 @@
static int enc_pfcp_header(struct msgb *msg, const struct osmo_pfcp_msg *m)
{
const struct osmo_pfcp_header_parsed *parsed = &m->h;
- struct osmo_pfcp_header_seid *h_seid;
- struct osmo_pfcp_header_no_seid *h_no_seid;
+ struct osmo_pfcp_header_seid *h_seid = NULL;
+ struct osmo_pfcp_header_no_seid *h_no_seid = NULL;
struct osmo_pfcp_header_common *c;
int rc;


To view, visit change 29054. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-pfcp
Gerrit-Branch: master
Gerrit-Change-Id: Icb338b200fe3186ccd7fd3f502c1723f60947190
Gerrit-Change-Number: 29054
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-MessageType: newchange