Commit d09eb198 authored by Olivier Crête's avatar Olivier Crête

example: Prevent possible non-NULL terminated string

parent 44395d81
...@@ -308,6 +308,7 @@ parse_candidate(char *scand, guint _stream_id) ...@@ -308,6 +308,7 @@ parse_candidate(char *scand, guint _stream_id)
cand->stream_id = _stream_id; cand->stream_id = _stream_id;
cand->transport = NICE_CANDIDATE_TRANSPORT_UDP; cand->transport = NICE_CANDIDATE_TRANSPORT_UDP;
strncpy(cand->foundation, tokens[0], NICE_CANDIDATE_MAX_FOUNDATION); strncpy(cand->foundation, tokens[0], NICE_CANDIDATE_MAX_FOUNDATION);
cand->foundation[NICE_CANDIDATE_MAX_FOUNDATION - 1] = 0;
cand->priority = atoi (tokens[1]); cand->priority = atoi (tokens[1]);
if (!nice_address_set_from_string(&cand->addr, tokens[2])) { if (!nice_address_set_from_string(&cand->addr, tokens[2])) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment