mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 23:37:22 +00:00
ogs_fqdn_parse: Write the terminating NULL byte even if the APN is empty
Enter the while loop even if length == 1 (with len being 0) so that the terminating NULL byte is written to dst.
This commit is contained in:
parent
591f0a2fca
commit
28f9de4b41
1 changed files with 1 additions and 1 deletions
|
|
@ -416,7 +416,7 @@ int ogs_fqdn_parse(char *dst, const char *src, int length)
|
|||
int i = 0, j = 0;
|
||||
uint8_t len = 0;
|
||||
|
||||
while (i+1 < length) {
|
||||
while (i+1 <= length) {
|
||||
len = src[i++];
|
||||
if ((j + len + 1) > length) {
|
||||
ogs_error("Invalid FQDN encoding[j:%d+len:%d] + 1 > length[%d]",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue