diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2014-04-24 21:32:12 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2014-04-24 21:34:45 -0400 |
commit | d09eb198a818f4c8f2285511cf31723534ee161a (patch) | |
tree | 076726576a125a0cc6016fe171a5a5183fcd5bd1 /examples | |
parent | 44395d8175c5fc406270192b2d6fdfc3b297c901 (diff) | |
download | libnice-d09eb198a818f4c8f2285511cf31723534ee161a.tar.gz |
example: Prevent possible non-NULL terminated string
Diffstat (limited to 'examples')
-rw-r--r-- | examples/simple-example.c | 1 |
1 files changed, 1 insertions, 0 deletions
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])) { |