projects
/
platform
/
upstream
/
elementary.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1da5889
)
elm_prefs.c: make the string null terminated.
author
Daniel Juyung Seo
<seojuyung2@gmail.com>
Sun, 11 Aug 2013 08:21:31 +0000
(17:21 +0900)
committer
Daniel Juyung Seo
<seojuyung2@gmail.com>
Sun, 11 Aug 2013 08:21:31 +0000
(17:21 +0900)
This fixes coverity CID 1046593 : Buffer not null terminated (BUFFER_SIZE_WARNING).
src/lib/elm_prefs.c
patch
|
blob
|
history
diff --git
a/src/lib/elm_prefs.c
b/src/lib/elm_prefs.c
index
f2b8b3f
..
43e8b7e
100644
(file)
--- a/
src/lib/elm_prefs.c
+++ b/
src/lib/elm_prefs.c
@@
-333,7
+333,8
@@
_elm_prefs_item_node_by_name(Elm_Prefs_Smart_Data *sd,
char *token;
char *aux = buf;
- strncpy(buf, name, PATH_MAX);
+ strncpy(buf, name, PATH_MAX - 1);
+ buf[PATH_MAX - 1] = '\0';
token = strsep(&aux, ":");