diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-10-11 20:32:55 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-10-11 20:37:24 +0200 |
commit | 958256f5cfd19610ecec8b1130f726b7a6bb17fc (patch) | |
tree | 5529d489790a036bd810c842dba4341c5b2f512b /ggsn | |
parent | 6748dc90b8c2a0ec57a5d05eb28c20a5002afbbc (diff) |
create_context_ind(): Fix crash on apn not found
Program terminated with signal SIGSEGV, Segmentation fault.
0 create_context_ind (pdp=0xb6b391b0 <pdpa>)
at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453
453 if (!apn->started)
(gdb) bt
0 create_context_ind (pdp=0xb6b391b0 <pdpa>)
at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:453
1 0xb6b225e0 in gtp_create_pdp_ind (gsn=gsn@entry=0x74f28, version=version@entry=1, peer=0x0,
peer@entry=0xbee6ead4, fd=-1092167056, fd@entry=8, pack=pack@entry=0xbee6eae4, len=len@entry=179)
at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:1591
2 0xb6b245e4 in gtp_decaps1c (gsn=0x74f28)
at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/gtp/gtp.c:2986
3 0x41d770c0 in osmo_select_main () from /usr/lib/libosmocore.so.8
4 0x000121b8 in main (argc=4, argv=0xbee70e54)
at /usr/src/debug/osmo-ggsn/1.0.0+gitrAUTOINC+ab5e160937-r0/git/ggsn/ggsn.c:897
Fixes: dd266066c7cc96c797034da352cc9d72177c5780, b16c46b4c36383368eb1581e40d0a8ca751ddc53
Change-Id: Ie4ec74e87aaf1d067dd1717d986673be56c4d6ed
Diffstat (limited to 'ggsn')
-rw-r--r-- | ggsn/ggsn.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 5852ef6..6c5c1a8 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -449,14 +449,14 @@ int create_context_ind(struct pdp_t *pdp) /* First find an exact APN name match */ apn = ggsn_find_apn(ggsn, name_buf); /* ignore if the APN has not been started */ - if (!apn->started) + if (apn && !apn->started) apn = NULL; /* then try default (if any) */ if (!apn) apn = ggsn->cfg.default_apn; /* ignore if the APN has not been started */ - if (!apn->started) + if (apn && !apn->started) apn = NULL; if (!apn) { |