From d09eb198a818f4c8f2285511cf31723534ee161a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 24 Apr 2014 21:32:12 -0400 Subject: [PATCH] example: Prevent possible non-NULL terminated string --- examples/simple-example.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/simple-example.c b/examples/simple-example.c index 397a333..76a39c8 100644 --- a/examples/simple-example.c +++ b/examples/simple-example.c @@ -308,6 +308,7 @@ parse_candidate(char *scand, guint _stream_id) cand->stream_id = _stream_id; cand->transport = NICE_CANDIDATE_TRANSPORT_UDP; strncpy(cand->foundation, tokens[0], NICE_CANDIDATE_MAX_FOUNDATION); + cand->foundation[NICE_CANDIDATE_MAX_FOUNDATION - 1] = 0; cand->priority = atoi (tokens[1]); if (!nice_address_set_from_string(&cand->addr, tokens[2])) { -- 2.7.4