mirror of https://gerrit.osmocom.org/libosmocore
gprs: Make sure that the buf is NULL terminated at the end
Fixes: Coverity CID 1107253
This commit is contained in:
parent
7fcb3ce2df
commit
0cccf40860
|
@ -1053,6 +1053,7 @@ const char *gprs_ns_ll_str(struct gprs_nsvc *nsvc)
|
|||
snprintf(buf, sizeof(buf), "%s:%u",
|
||||
inet_ntoa(nsvc->ip.bts_addr.sin_addr),
|
||||
ntohs(nsvc->ip.bts_addr.sin_port));
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue