gprs: Make sure that the buf is NULL terminated at the end

Fixes: Coverity CID 1107253
This commit is contained in:
Holger Hans Peter Freyther 2013-10-25 11:00:23 +02:00
parent 7fcb3ce2df
commit 0cccf40860
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}