Changes of Revision 559

commit_531e301f4de5ecc294223393fc19d2a995b92379.txt Deleted
commit_92515a9721b1fe60e347ecc153ead44d335d3dd3.txt Added
open5gs_2.7.2.4565.531e.dsc -> open5gs_2.7.2.4566.9251.dsc Changed
x
 
1
@@ -2,7 +2,7 @@
2
 Source: open5gs
3
 Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-sepp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg
4
 Architecture: any
5
-Version: 2.7.2.4565.531e
6
+Version: 2.7.2.4566.9251
7
 Maintainer: Harald Welte <laforge@gnumonks.org>
8
 Uploaders: Sukchan Lee <acetcom@gmail.com>
9
 Homepage: https://open5gs.org
10
@@ -32,8 +32,8 @@
11
  open5gs-udr deb net optional arch=any
12
  open5gs-upf deb net optional arch=any
13
 Checksums-Sha1:
14
- 9efebd4f13cc239facf5e22fd45ea9df3d749e27 14513204 open5gs_2.7.2.4565.531e.tar.xz
15
+ c47a73ae6b42f7919124e5f82fc11e07e5fde6b3 14512112 open5gs_2.7.2.4566.9251.tar.xz
16
 Checksums-Sha256:
17
- c425f50181f6cef56bdf6ef94c2a2d27367deae31aaea6a1f72ce4df747d2060 14513204 open5gs_2.7.2.4565.531e.tar.xz
18
+ 203614e20d765526ee2b15e3bd5d6c52ced5b55a7d50336b6cbbf0e8c078a9f9 14512112 open5gs_2.7.2.4566.9251.tar.xz
19
 Files:
20
- e669277a5edd34ebb44c1040027395de 14513204 open5gs_2.7.2.4565.531e.tar.xz
21
+ 986b58927931359888f7600ead476ecf 14512112 open5gs_2.7.2.4566.9251.tar.xz
22
open5gs_2.7.2.4565.531e.tar.xz/.tarball-version -> open5gs_2.7.2.4566.9251.tar.xz/.tarball-version Changed
4
 
1
@@ -1 +1 @@
2
-2.7.2.4565-531e
3
+2.7.2.4566-9251
4
open5gs_2.7.2.4565.531e.tar.xz/debian/changelog -> open5gs_2.7.2.4566.9251.tar.xz/debian/changelog Changed
12
 
1
@@ -1,8 +1,8 @@
2
-open5gs (2.7.2.4565.531e) unstable; urgency=medium
3
+open5gs (2.7.2.4566.9251) unstable; urgency=medium
4
 
5
   * Automatically generated changelog entry for building the Osmocom master feed
6
 
7
- -- Osmocom OBS scripts <info@osmocom.org>  Wed, 11 Dec 2024 12:03:58 +0000
8
+ -- Osmocom OBS scripts <info@osmocom.org>  Wed, 11 Dec 2024 12:27:42 +0000
9
 
10
 open5gs (2.7.2) unstable; urgency=medium
11
 
12
open5gs_2.7.2.4565.531e.tar.xz/lib/nas/5gs/ies.c -> open5gs_2.7.2.4566.9251.tar.xz/lib/nas/5gs/ies.c Changed
201
 
1
@@ -28,7 +28,7 @@
2
 /*******************************************************************************
3
  * This file had been created by nas-message.py script v0.2.0
4
  * Please do not modify this file but regenerate it via script.
5
- * Created on: 2024-01-21 18:47:47.812038 by acetcom
6
+ * Created on: 2024-12-11 21:13:08.097860 by acetcom
7
  * from 24501-h90.docx
8
  ******************************************************************************/
9
 
10
@@ -48,7 +48,14 @@
11
 int ogs_nas_5gs_decode_additional_information(ogs_nas_additional_information_t *additional_information, ogs_pkbuf_t *pkbuf)
12
 {
13
     int size = 0;
14
-    ogs_nas_additional_information_t *source = (ogs_nas_additional_information_t *)pkbuf->data;
15
+    ogs_nas_additional_information_t *source = NULL;
16
+
17
+    if (pkbuf->len < 1) {
18
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
19
+       return -1;
20
+    }
21
+
22
+    source = (ogs_nas_additional_information_t *)pkbuf->data;
23
 
24
     additional_information->length = source->length;
25
     size = additional_information->length + sizeof(additional_information->length);
26
@@ -87,7 +94,14 @@
27
 int ogs_nas_5gs_decode_service_level_aa_container(ogs_nas_service_level_aa_container_t *service_level_aa_container, ogs_pkbuf_t *pkbuf)
28
 {
29
     int size = 0;
30
-    ogs_nas_service_level_aa_container_t *source = (ogs_nas_service_level_aa_container_t *)pkbuf->data;
31
+    ogs_nas_service_level_aa_container_t *source = NULL;
32
+
33
+    if (pkbuf->len < 2) {
34
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
35
+       return -1;
36
+    }
37
+
38
+    source = (ogs_nas_service_level_aa_container_t *)pkbuf->data;
39
 
40
     service_level_aa_container->length = be16toh(source->length);
41
     size = service_level_aa_container->length + sizeof(service_level_aa_container->length);
42
@@ -167,7 +181,14 @@
43
 int ogs_nas_5gs_decode_dnn(ogs_nas_dnn_t *dnn, ogs_pkbuf_t *pkbuf)
44
 {
45
     int size = 0;
46
-    ogs_nas_dnn_t *source = (ogs_nas_dnn_t *)pkbuf->data;
47
+    ogs_nas_dnn_t *source = NULL;
48
+
49
+    if (pkbuf->len < 1) {
50
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
51
+       return -1;
52
+    }
53
+
54
+    source = (ogs_nas_dnn_t *)pkbuf->data;
55
 
56
     dnn->length = source->length;
57
     size = dnn->length + sizeof(dnn->length);
58
@@ -219,7 +240,14 @@
59
 int ogs_nas_5gs_decode_eap_message(ogs_nas_eap_message_t *eap_message, ogs_pkbuf_t *pkbuf)
60
 {
61
     int size = 0;
62
-    ogs_nas_eap_message_t *source = (ogs_nas_eap_message_t *)pkbuf->data;
63
+    ogs_nas_eap_message_t *source = NULL;
64
+
65
+    if (pkbuf->len < 2) {
66
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
67
+       return -1;
68
+    }
69
+
70
+    source = (ogs_nas_eap_message_t *)pkbuf->data;
71
 
72
     eap_message->length = be16toh(source->length);
73
     size = eap_message->length + sizeof(eap_message->length);
74
@@ -299,7 +327,14 @@
75
 int ogs_nas_5gs_decode_gprs_timer_2(ogs_nas_gprs_timer_2_t *gprs_timer_2, ogs_pkbuf_t *pkbuf)
76
 {
77
     int size = 0;
78
-    ogs_nas_gprs_timer_2_t *source = (ogs_nas_gprs_timer_2_t *)pkbuf->data;
79
+    ogs_nas_gprs_timer_2_t *source = NULL;
80
+
81
+    if (pkbuf->len < 1) {
82
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
83
+       return -1;
84
+    }
85
+
86
+    source = (ogs_nas_gprs_timer_2_t *)pkbuf->data;
87
 
88
     gprs_timer_2->length = source->length;
89
     size = gprs_timer_2->length + sizeof(gprs_timer_2->length);
90
@@ -338,7 +373,14 @@
91
 int ogs_nas_5gs_decode_gprs_timer_3(ogs_nas_gprs_timer_3_t *gprs_timer_3, ogs_pkbuf_t *pkbuf)
92
 {
93
     int size = 0;
94
-    ogs_nas_gprs_timer_3_t *source = (ogs_nas_gprs_timer_3_t *)pkbuf->data;
95
+    ogs_nas_gprs_timer_3_t *source = NULL;
96
+
97
+    if (pkbuf->len < 1) {
98
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
99
+       return -1;
100
+    }
101
+
102
+    source = (ogs_nas_gprs_timer_3_t *)pkbuf->data;
103
 
104
     gprs_timer_3->length = source->length;
105
     size = gprs_timer_3->length + sizeof(gprs_timer_3->length);
106
@@ -377,7 +419,14 @@
107
 int ogs_nas_5gs_decode_s_nssai(ogs_nas_s_nssai_t *s_nssai, ogs_pkbuf_t *pkbuf)
108
 {
109
     int size = 0;
110
-    ogs_nas_s_nssai_t *source = (ogs_nas_s_nssai_t *)pkbuf->data;
111
+    ogs_nas_s_nssai_t *source = NULL;
112
+
113
+    if (pkbuf->len < 1) {
114
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
115
+       return -1;
116
+    }
117
+
118
+    source = (ogs_nas_s_nssai_t *)pkbuf->data;
119
 
120
     s_nssai->length = source->length;
121
     size = s_nssai->length + sizeof(s_nssai->length);
122
@@ -416,7 +465,14 @@
123
 int ogs_nas_5gs_decode_5gmm_capability(ogs_nas_5gmm_capability_t *gmm_capability, ogs_pkbuf_t *pkbuf)
124
 {
125
     int size = 0;
126
-    ogs_nas_5gmm_capability_t *source = (ogs_nas_5gmm_capability_t *)pkbuf->data;
127
+    ogs_nas_5gmm_capability_t *source = NULL;
128
+
129
+    if (pkbuf->len < 1) {
130
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
131
+       return -1;
132
+    }
133
+
134
+    source = (ogs_nas_5gmm_capability_t *)pkbuf->data;
135
 
136
     gmm_capability->length = source->length;
137
     size = gmm_capability->length + sizeof(gmm_capability->length);
138
@@ -455,7 +511,14 @@
139
 int ogs_nas_5gs_decode_abba(ogs_nas_abba_t *abba, ogs_pkbuf_t *pkbuf)
140
 {
141
     int size = 0;
142
-    ogs_nas_abba_t *source = (ogs_nas_abba_t *)pkbuf->data;
143
+    ogs_nas_abba_t *source = NULL;
144
+
145
+    if (pkbuf->len < 1) {
146
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
147
+       return -1;
148
+    }
149
+
150
+    source = (ogs_nas_abba_t *)pkbuf->data;
151
 
152
     abba->length = source->length;
153
     size = abba->length + sizeof(abba->length);
154
@@ -494,7 +557,14 @@
155
 int ogs_nas_5gs_decode_additional_5g_security_information(ogs_nas_additional_5g_security_information_t *additional_security_information, ogs_pkbuf_t *pkbuf)
156
 {
157
     int size = 0;
158
-    ogs_nas_additional_5g_security_information_t *source = (ogs_nas_additional_5g_security_information_t *)pkbuf->data;
159
+    ogs_nas_additional_5g_security_information_t *source = NULL;
160
+
161
+    if (pkbuf->len < 1) {
162
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
163
+       return -1;
164
+    }
165
+
166
+    source = (ogs_nas_additional_5g_security_information_t *)pkbuf->data;
167
 
168
     additional_security_information->length = source->length;
169
     size = additional_security_information->length + sizeof(additional_security_information->length);
170
@@ -533,7 +603,14 @@
171
 int ogs_nas_5gs_decode_additional_information_requested(ogs_nas_additional_information_requested_t *additional_information_requested, ogs_pkbuf_t *pkbuf)
172
 {
173
     int size = 0;
174
-    ogs_nas_additional_information_requested_t *source = (ogs_nas_additional_information_requested_t *)pkbuf->data;
175
+    ogs_nas_additional_information_requested_t *source = NULL;
176
+
177
+    if (pkbuf->len < 1) {
178
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
179
+       return -1;
180
+    }
181
+
182
+    source = (ogs_nas_additional_information_requested_t *)pkbuf->data;
183
 
184
     additional_information_requested->length = source->length;
185
     size = additional_information_requested->length + sizeof(additional_information_requested->length);
186
@@ -572,7 +649,14 @@
187
 int ogs_nas_5gs_decode_allowed_pdu_session_status(ogs_nas_allowed_pdu_session_status_t *allowed_pdu_session_status, ogs_pkbuf_t *pkbuf)
188
 {
189
     int size = 0;
190
-    ogs_nas_allowed_pdu_session_status_t *source = (ogs_nas_allowed_pdu_session_status_t *)pkbuf->data;
191
+    ogs_nas_allowed_pdu_session_status_t *source = NULL;
192
+
193
+    if (pkbuf->len < 1) {
194
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
195
+       return -1;
196
+    }
197
+
198
+    source = (ogs_nas_allowed_pdu_session_status_t *)pkbuf->data;
199
 
200
     allowed_pdu_session_status->length = source->length;
201
open5gs_2.7.2.4565.531e.tar.xz/lib/nas/5gs/support/nas-message.py -> open5gs_2.7.2.4566.9251.tar.xz/lib/nas/5gs/support/nas-message.py Changed
29
 
1
@@ -447,7 +447,12 @@
2
         f.write("int ogs_nas_5gs_decode_%s(ogs_nas_%s_t *%s, ogs_pkbuf_t *pkbuf)\n" % (v_lower(k), v_lower(k), get_value(k)))
3
         f.write("{\n")
4
         f.write("    int size = 0;\n")
5
-        f.write("    ogs_nas_%s_t *source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % (v_lower(k), v_lower(k)))
6
+        f.write("    ogs_nas_%s_t *source = NULL;\n\n" % v_lower(k))
7
+        f.write("    if (pkbuf->len < 2) {\n")
8
+        f.write("       ogs_error(\"Not enough pkbuf len:%d\", pkbuf->len);\n")
9
+        f.write("       return -1;\n")
10
+        f.write("    }\n\n")
11
+        f.write("    source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % v_lower(k))
12
         f.write("    %s->length = be16toh(source->length);\n" % get_value(k))
13
         f.write("    size = %s->length + sizeof(%s->length);\n\n" % (get_value(k), get_value(k)))
14
         f.write("    if (ogs_pkbuf_pull(pkbuf, size) == NULL) {\n")
15
@@ -480,7 +485,12 @@
16
         f.write("int ogs_nas_5gs_decode_%s(ogs_nas_%s_t *%s, ogs_pkbuf_t *pkbuf)\n" % (v_lower(k), v_lower(k), get_value(k)))
17
         f.write("{\n")
18
         f.write("    int size = 0;\n")
19
-        f.write("    ogs_nas_%s_t *source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % (v_lower(k), v_lower(k)))
20
+        f.write("    ogs_nas_%s_t *source = NULL;\n\n" % v_lower(k))
21
+        f.write("    if (pkbuf->len < 1) {\n")
22
+        f.write("       ogs_error(\"Not enough pkbuf len:%d\", pkbuf->len);\n")
23
+        f.write("       return -1;\n")
24
+        f.write("    }\n\n")
25
+        f.write("    source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % v_lower(k))
26
         f.write("    %s->length = source->length;\n" % get_value(k))
27
         f.write("    size = %s->length + sizeof(%s->length);\n\n" % (get_value(k), get_value(k)))
28
         f.write("    if (ogs_pkbuf_pull(pkbuf, size) == NULL) {\n")
29
open5gs_2.7.2.4565.531e.tar.xz/lib/nas/eps/ies.c -> open5gs_2.7.2.4566.9251.tar.xz/lib/nas/eps/ies.c Changed
201
 
1
@@ -28,7 +28,7 @@
2
 /*******************************************************************************
3
  * This file had been created by nas-message.py script v0.1.0
4
  * Please do not modify this file but regenerate it via script.
5
- * Created on: 2024-01-21 18:50:03.402793 by acetcom
6
+ * Created on: 2024-12-11 21:08:02.462921 by acetcom
7
  * from 24301-h90.docx
8
  ******************************************************************************/
9
 
10
@@ -48,7 +48,14 @@
11
 int ogs_nas_eps_decode_additional_information(ogs_nas_additional_information_t *additional_information, ogs_pkbuf_t *pkbuf)
12
 {
13
     int size = 0;
14
-    ogs_nas_additional_information_t *source = (ogs_nas_additional_information_t *)pkbuf->data;
15
+    ogs_nas_additional_information_t *source = NULL;
16
+
17
+    if (pkbuf->len < 1) {
18
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
19
+       return -1;
20
+    }
21
+
22
+    source = (ogs_nas_additional_information_t *)pkbuf->data;
23
 
24
     additional_information->length = source->length;
25
     size = additional_information->length + sizeof(additional_information->length);
26
@@ -119,7 +126,14 @@
27
 int ogs_nas_eps_decode_eps_bearer_context_status(ogs_nas_eps_bearer_context_status_t *eps_bearer_context_status, ogs_pkbuf_t *pkbuf)
28
 {
29
     int size = 0;
30
-    ogs_nas_eps_bearer_context_status_t *source = (ogs_nas_eps_bearer_context_status_t *)pkbuf->data;
31
+    ogs_nas_eps_bearer_context_status_t *source = NULL;
32
+
33
+    if (pkbuf->len < 1) {
34
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
35
+       return -1;
36
+    }
37
+
38
+    source = (ogs_nas_eps_bearer_context_status_t *)pkbuf->data;
39
 
40
     eps_bearer_context_status->length = source->length;
41
     size = eps_bearer_context_status->length + sizeof(eps_bearer_context_status->length);
42
@@ -158,7 +172,14 @@
43
 int ogs_nas_eps_decode_supported_codec_list(ogs_nas_supported_codec_list_t *supported_codec_list, ogs_pkbuf_t *pkbuf)
44
 {
45
     int size = 0;
46
-    ogs_nas_supported_codec_list_t *source = (ogs_nas_supported_codec_list_t *)pkbuf->data;
47
+    ogs_nas_supported_codec_list_t *source = NULL;
48
+
49
+    if (pkbuf->len < 1) {
50
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
51
+       return -1;
52
+    }
53
+
54
+    source = (ogs_nas_supported_codec_list_t *)pkbuf->data;
55
 
56
     supported_codec_list->length = source->length;
57
     size = supported_codec_list->length + sizeof(supported_codec_list->length);
58
@@ -235,7 +256,14 @@
59
 int ogs_nas_eps_decode_mobile_identity(ogs_nas_mobile_identity_t *mobile_identity, ogs_pkbuf_t *pkbuf)
60
 {
61
     int size = 0;
62
-    ogs_nas_mobile_identity_t *source = (ogs_nas_mobile_identity_t *)pkbuf->data;
63
+    ogs_nas_mobile_identity_t *source = NULL;
64
+
65
+    if (pkbuf->len < 1) {
66
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
67
+       return -1;
68
+    }
69
+
70
+    source = (ogs_nas_mobile_identity_t *)pkbuf->data;
71
 
72
     mobile_identity->length = source->length;
73
     size = mobile_identity->length + sizeof(mobile_identity->length);
74
@@ -283,7 +311,14 @@
75
 int ogs_nas_eps_decode_mobile_station_classmark_2(ogs_nas_mobile_station_classmark_2_t *mobile_station_classmark_2, ogs_pkbuf_t *pkbuf)
76
 {
77
     int size = 0;
78
-    ogs_nas_mobile_station_classmark_2_t *source = (ogs_nas_mobile_station_classmark_2_t *)pkbuf->data;
79
+    ogs_nas_mobile_station_classmark_2_t *source = NULL;
80
+
81
+    if (pkbuf->len < 1) {
82
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
83
+       return -1;
84
+    }
85
+
86
+    source = (ogs_nas_mobile_station_classmark_2_t *)pkbuf->data;
87
 
88
     mobile_station_classmark_2->length = source->length;
89
     size = mobile_station_classmark_2->length + sizeof(mobile_station_classmark_2->length);
90
@@ -322,7 +357,14 @@
91
 int ogs_nas_eps_decode_mobile_station_classmark_3(ogs_nas_mobile_station_classmark_3_t *mobile_station_classmark_3, ogs_pkbuf_t *pkbuf)
92
 {
93
     int size = 0;
94
-    ogs_nas_mobile_station_classmark_3_t *source = (ogs_nas_mobile_station_classmark_3_t *)pkbuf->data;
95
+    ogs_nas_mobile_station_classmark_3_t *source = NULL;
96
+
97
+    if (pkbuf->len < 1) {
98
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
99
+       return -1;
100
+    }
101
+
102
+    source = (ogs_nas_mobile_station_classmark_3_t *)pkbuf->data;
103
 
104
     mobile_station_classmark_3->length = source->length;
105
     size = mobile_station_classmark_3->length + sizeof(mobile_station_classmark_3->length);
106
@@ -361,7 +403,14 @@
107
 int ogs_nas_eps_decode_plmn_list(ogs_nas_plmn_list_t *plmn_list, ogs_pkbuf_t *pkbuf)
108
 {
109
     int size = 0;
110
-    ogs_nas_plmn_list_t *source = (ogs_nas_plmn_list_t *)pkbuf->data;
111
+    ogs_nas_plmn_list_t *source = NULL;
112
+
113
+    if (pkbuf->len < 1) {
114
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
115
+       return -1;
116
+    }
117
+
118
+    source = (ogs_nas_plmn_list_t *)pkbuf->data;
119
 
120
     plmn_list->length = source->length;
121
     size = plmn_list->length + sizeof(plmn_list->length);
122
@@ -464,7 +513,14 @@
123
 int ogs_nas_eps_decode_authentication_failure_parameter(ogs_nas_authentication_failure_parameter_t *authentication_failure_parameter, ogs_pkbuf_t *pkbuf)
124
 {
125
     int size = 0;
126
-    ogs_nas_authentication_failure_parameter_t *source = (ogs_nas_authentication_failure_parameter_t *)pkbuf->data;
127
+    ogs_nas_authentication_failure_parameter_t *source = NULL;
128
+
129
+    if (pkbuf->len < 1) {
130
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
131
+       return -1;
132
+    }
133
+
134
+    source = (ogs_nas_authentication_failure_parameter_t *)pkbuf->data;
135
 
136
     authentication_failure_parameter->length = source->length;
137
     size = authentication_failure_parameter->length + sizeof(authentication_failure_parameter->length);
138
@@ -571,7 +627,14 @@
139
 int ogs_nas_eps_decode_eps_mobile_identity(ogs_nas_eps_mobile_identity_t *eps_mobile_identity, ogs_pkbuf_t *pkbuf)
140
 {
141
     int size = 0;
142
-    ogs_nas_eps_mobile_identity_t *source = (ogs_nas_eps_mobile_identity_t *)pkbuf->data;
143
+    ogs_nas_eps_mobile_identity_t *source = NULL;
144
+
145
+    if (pkbuf->len < 1) {
146
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
147
+       return -1;
148
+    }
149
+
150
+    source = (ogs_nas_eps_mobile_identity_t *)pkbuf->data;
151
 
152
     eps_mobile_identity->length = source->length;
153
     size = eps_mobile_identity->length + sizeof(eps_mobile_identity->length);
154
@@ -621,7 +684,14 @@
155
 int ogs_nas_eps_decode_eps_network_feature_support(ogs_nas_eps_network_feature_support_t *eps_network_feature_support, ogs_pkbuf_t *pkbuf)
156
 {
157
     int size = 0;
158
-    ogs_nas_eps_network_feature_support_t *source = (ogs_nas_eps_network_feature_support_t *)pkbuf->data;
159
+    ogs_nas_eps_network_feature_support_t *source = NULL;
160
+
161
+    if (pkbuf->len < 1) {
162
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
163
+       return -1;
164
+    }
165
+
166
+    source = (ogs_nas_eps_network_feature_support_t *)pkbuf->data;
167
 
168
     eps_network_feature_support->length = source->length;
169
     size = eps_network_feature_support->length + sizeof(eps_network_feature_support->length);
170
@@ -728,7 +798,14 @@
171
 int ogs_nas_eps_decode_esm_message_container(ogs_nas_esm_message_container_t *esm_message_container, ogs_pkbuf_t *pkbuf)
172
 {
173
     int size = 0;
174
-    ogs_nas_esm_message_container_t *source = (ogs_nas_esm_message_container_t *)pkbuf->data;
175
+    ogs_nas_esm_message_container_t *source = NULL;
176
+
177
+    if (pkbuf->len < 2) {
178
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
179
+       return -1;
180
+    }
181
+
182
+    source = (ogs_nas_esm_message_container_t *)pkbuf->data;
183
 
184
     esm_message_container->length = be16toh(source->length);
185
     size = esm_message_container->length + sizeof(esm_message_container->length);
186
@@ -808,7 +885,14 @@
187
 int ogs_nas_eps_decode_gprs_timer_2(ogs_nas_gprs_timer_2_t *gprs_timer_2, ogs_pkbuf_t *pkbuf)
188
 {
189
     int size = 0;
190
-    ogs_nas_gprs_timer_2_t *source = (ogs_nas_gprs_timer_2_t *)pkbuf->data;
191
+    ogs_nas_gprs_timer_2_t *source = NULL;
192
+
193
+    if (pkbuf->len < 1) {
194
+       ogs_error("Not enough pkbuf len:%d", pkbuf->len);
195
+       return -1;
196
+    }
197
+
198
+    source = (ogs_nas_gprs_timer_2_t *)pkbuf->data;
199
 
200
     gprs_timer_2->length = source->length;
201
open5gs_2.7.2.4565.531e.tar.xz/lib/nas/eps/support/nas-message.py -> open5gs_2.7.2.4566.9251.tar.xz/lib/nas/eps/support/nas-message.py Changed
29
 
1
@@ -461,7 +461,12 @@
2
         f.write("int ogs_nas_eps_decode_%s(ogs_nas_%s_t *%s, ogs_pkbuf_t *pkbuf)\n" % (v_lower(k), v_lower(k), v_lower(k)))
3
         f.write("{\n")
4
         f.write("    int size = 0;\n")
5
-        f.write("    ogs_nas_%s_t *source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % (v_lower(k), v_lower(k)))
6
+        f.write("    ogs_nas_%s_t *source = NULL;\n\n" % v_lower(k))
7
+        f.write("    if (pkbuf->len < 2) {\n")
8
+        f.write("       ogs_error(\"Not enough pkbuf len:%d\", pkbuf->len);\n")
9
+        f.write("       return -1;\n")
10
+        f.write("    }\n\n")
11
+        f.write("    source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % v_lower(k))
12
         f.write("    %s->length = be16toh(source->length);\n" % v_lower(k))
13
         f.write("    size = %s->length + sizeof(%s->length);\n\n" % (v_lower(k), v_lower(k)))
14
         f.write("    if (ogs_pkbuf_pull(pkbuf, size) == NULL) {\n")
15
@@ -494,7 +499,12 @@
16
         f.write("int ogs_nas_eps_decode_%s(ogs_nas_%s_t *%s, ogs_pkbuf_t *pkbuf)\n" % (v_lower(k), v_lower(k), v_lower(k)))
17
         f.write("{\n")
18
         f.write("    int size = 0;\n")
19
-        f.write("    ogs_nas_%s_t *source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % (v_lower(k), v_lower(k)))
20
+        f.write("    ogs_nas_%s_t *source = NULL;\n\n" % v_lower(k))
21
+        f.write("    if (pkbuf->len < 1) {\n")
22
+        f.write("       ogs_error(\"Not enough pkbuf len:%d\", pkbuf->len);\n")
23
+        f.write("       return -1;\n")
24
+        f.write("    }\n\n")
25
+        f.write("    source = (ogs_nas_%s_t *)pkbuf->data;\n\n" % v_lower(k))
26
         f.write("    %s->length = source->length;\n" % v_lower(k))
27
         f.write("    size = %s->length + sizeof(%s->length);\n\n" % (v_lower(k), v_lower(k)))
28
         f.write("    if (ogs_pkbuf_pull(pkbuf, size) == NULL) {\n")
29