forked from acouzens/open5gs
MME/AMF will not crash with no APN length (#1199)
This commit is contained in:
parent
7db0c039a1
commit
f05accc7f3
|
@ -324,7 +324,7 @@ int ogs_fqdn_parse(char *dst, char *src, int length)
|
|||
int i = 0, j = 0;
|
||||
uint8_t len = 0;
|
||||
|
||||
do {
|
||||
while (i < length) {
|
||||
len = src[i++];
|
||||
if ((j + len + 1) > length) {
|
||||
ogs_error("Invalid APN encoding[len:%d] + 1 > length[%d]",
|
||||
|
@ -340,7 +340,7 @@ int ogs_fqdn_parse(char *dst, char *src, int length)
|
|||
dst[j++] = '.';
|
||||
else
|
||||
dst[j] = 0;
|
||||
} while (i < length);
|
||||
}
|
||||
|
||||
return j;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:38:42.729397 by acetcom
|
||||
* Created on: 2021-10-13 22:57:17.425900 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:38:42.737852 by acetcom
|
||||
* Created on: 2021-10-13 22:57:17.434442 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:38:42.717226 by acetcom
|
||||
* Created on: 2021-10-13 22:57:17.413540 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -137,8 +137,11 @@ int ogs_nas_5gs_decode_dnn(ogs_nas_dnn_t *dnn, ogs_pkbuf_t *pkbuf)
|
|||
{
|
||||
char data_network_name[OGS_MAX_DNN_LEN];
|
||||
dnn->length = ogs_fqdn_parse(data_network_name, dnn->value, ogs_min(dnn->length, OGS_MAX_DNN_LEN+1));
|
||||
ogs_assert(dnn->length > 0);
|
||||
ogs_cpystrn(dnn->value, data_network_name, ogs_min(dnn->length, OGS_MAX_DNN_LEN) + 1);
|
||||
if (dnn->length > 0) {
|
||||
ogs_cpystrn(dnn->value, data_network_name, ogs_min(dnn->length, OGS_MAX_DNN_LEN) + 1);
|
||||
} else {
|
||||
ogs_error("UE not APN setting");
|
||||
}
|
||||
}
|
||||
|
||||
ogs_trace(" DNN - ");
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:38:42.715187 by acetcom
|
||||
* Created on: 2021-10-13 22:57:17.411445 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:38:42.724015 by acetcom
|
||||
* Created on: 2021-10-13 22:57:17.420408 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -30,8 +30,11 @@ type_list["DNN"]["decode"] = \
|
|||
" {\n" \
|
||||
" char data_network_name[OGS_MAX_DNN_LEN];\n" \
|
||||
" dnn->length = ogs_fqdn_parse(data_network_name, dnn->value, ogs_min(dnn->length, OGS_MAX_DNN_LEN+1));\n" \
|
||||
" ogs_assert(dnn->length > 0);\n" \
|
||||
" ogs_cpystrn(dnn->value, data_network_name, ogs_min(dnn->length, OGS_MAX_DNN_LEN) + 1);\n" \
|
||||
" if (dnn->length > 0) {\n" \
|
||||
" ogs_cpystrn(dnn->value, data_network_name, ogs_min(dnn->length, OGS_MAX_DNN_LEN) + 1);\n" \
|
||||
" } else {\n" \
|
||||
" ogs_error(\"UE not APN setting\");\n" \
|
||||
" }\n" \
|
||||
" }\n\n"
|
||||
|
||||
type_list["DNN"]["encode"] = \
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:40:09.595336 by acetcom
|
||||
* Created on: 2021-10-13 22:56:00.082596 by acetcom
|
||||
* from 24301-g40.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:40:09.604726 by acetcom
|
||||
* Created on: 2021-10-13 22:56:00.091945 by acetcom
|
||||
* from 24301-g40.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:40:09.583395 by acetcom
|
||||
* Created on: 2021-10-13 22:56:00.070665 by acetcom
|
||||
* from 24301-g40.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -3014,9 +3014,12 @@ int ogs_nas_eps_decode_access_point_name(ogs_nas_access_point_name_t *access_poi
|
|||
|
||||
{
|
||||
char apn[OGS_MAX_APN_LEN];
|
||||
access_point_name->length = ogs_fqdn_parse(apn, access_point_name->apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN+1));
|
||||
ogs_assert(access_point_name->length > 0);
|
||||
ogs_cpystrn(access_point_name->apn, apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN) + 1);
|
||||
access_point_name->length = ogs_fqdn_parse(apn, access_point_name->apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN+1));
|
||||
if (access_point_name->length > 0) {
|
||||
ogs_cpystrn(access_point_name->apn, apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN) + 1);
|
||||
} else {
|
||||
ogs_error("UE not APN setting");
|
||||
}
|
||||
}
|
||||
|
||||
ogs_trace(" ACCESS_POINT_NAME - ");
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:40:09.581571 by acetcom
|
||||
* Created on: 2021-10-13 22:56:00.068858 by acetcom
|
||||
* from 24301-g40.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2021-10-01 22:40:09.588825 by acetcom
|
||||
* Created on: 2021-10-13 22:56:00.076081 by acetcom
|
||||
* from 24301-g40.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -71,9 +71,12 @@ type_list["Short MAC"]["encode"] = \
|
|||
type_list["Access point name"]["decode"] = \
|
||||
" {\n" \
|
||||
" char apn[OGS_MAX_APN_LEN];\n" \
|
||||
" access_point_name->length = ogs_fqdn_parse(apn, access_point_name->apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN+1));\n" \
|
||||
" ogs_assert(access_point_name->length > 0);\n" \
|
||||
" ogs_cpystrn(access_point_name->apn, apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN) + 1);\n" \
|
||||
" access_point_name->length = ogs_fqdn_parse(apn, access_point_name->apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN+1));\n" \
|
||||
" if (access_point_name->length > 0) {\n" \
|
||||
" ogs_cpystrn(access_point_name->apn, apn, ogs_min(access_point_name->length, OGS_MAX_APN_LEN) + 1);\n" \
|
||||
" } else {\n" \
|
||||
" ogs_error(\"UE not APN setting\");\n" \
|
||||
" }\n" \
|
||||
" }\n\n"
|
||||
|
||||
type_list["Access point name"]["encode"] = \
|
||||
|
|
Loading…
Reference in New Issue