aboutsummaryrefslogtreecommitdiffstats
path: root/gtp/gtp.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-08-30 21:23:11 +0200
committerlaforge <laforge@gnumonks.org>2019-09-02 09:03:43 +0000
commitbdf2cf9038e9e96c1952d9557bce8c58a4d5d624 (patch)
treee503ac43421d495a8196af1af4dd9b494c01df95 /gtp/gtp.c
parent00a6171b8de5863a54ba81e597fa4edbee65fd8e (diff)
gtp_error_ind_conf(): fix: guard against an unknown GTP version
This change fixes the following compiler warnings (found by Clang): gtp.c:2747:13: warning: variable 'pdp' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (version == 1) { gtp.c:2781:14: note: uninitialized use occurs here OSMO_ASSERT(pdp); ^^^ Shall not happen in general, but let's make Clang happy. Change-Id: Id471b22afd4c45435589a4edda0a804e66be3a7a
Diffstat (limited to 'gtp/gtp.c')
-rw-r--r--gtp/gtp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 7cb82b6..3979165 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -2743,6 +2743,9 @@ static int gtp_error_ind_conf(struct gsn_t *gsn, uint8_t version,
GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown PDP context\n");
return EOF;
}
+ } else {
+ LOGP(DLGTP, LOGL_ERROR, "Unknown version: %d\n", version);
+ return EOF;
}
GTP_LOGPKG(LOGL_ERROR, peer, pack, len,