From: Olivier CrĂȘte Date: Fri, 25 Apr 2014 01:32:12 +0000 (-0400) Subject: example: Prevent possible non-NULL terminated string X-Git-Tag: 0.1.6~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d09eb198a818f4c8f2285511cf31723534ee161a;p=platform%2Fupstream%2Flibnice.git example: Prevent possible non-NULL terminated string --- 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])) {