projects
/
platform
/
upstream
/
libnice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44395d8
)
example: Prevent possible non-NULL terminated string
author
Olivier Crête
<olivier.crete@collabora.com>
Fri, 25 Apr 2014 01:32:12 +0000
(21:32 -0400)
committer
Olivier Crête
<olivier.crete@collabora.com>
Fri, 25 Apr 2014 01:34:45 +0000
(21:34 -0400)
examples/simple-example.c
patch
|
blob
|
history
diff --git
a/examples/simple-example.c
b/examples/simple-example.c
index
397a333
..
76a39c8
100644
(file)
--- 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])) {