projects
/
platform
/
core
/
system
/
libdbuspolicy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6dc5ac0
)
Fix: properly check getgrgid_r() and getpwuid_r() function results
74/67174/1
accepted/tizen/common/20160425.145243
accepted/tizen/ivi/20160425.140133
accepted/tizen/mobile/20160425.135726
accepted/tizen/tv/20160425.135843
accepted/tizen/wearable/20160425.135929
submit/tizen/20160425.120058
author
Lukasz Skalski
<l.skalski@samsung.com>
Mon, 25 Apr 2016 11:35:24 +0000
(13:35 +0200)
committer
Lukasz Skalski
<l.skalski@samsung.com>
Mon, 25 Apr 2016 11:35:24 +0000
(13:35 +0200)
Change-Id: I3c780f9067d1b4aca2a0bc40f6ff2d2a1adf0347
src/libdbuspolicy1.c
patch
|
blob
|
history
diff --git
a/src/libdbuspolicy1.c
b/src/libdbuspolicy1.c
index
9ba7f47
..
d8163b7
100644
(file)
--- a/
src/libdbuspolicy1.c
+++ b/
src/libdbuspolicy1.c
@@
-246,6
+246,9
@@
static int dbuspolicy_init_udesc(struct kconn* kc, unsigned int bus_type, struct
if (getgrgid_r(p_udesc->gid, &grent, buf, sizeof(buf), &gg))
return -1;
+ if (!pwd || !gg)
+ return -1;
+
len = sizeof(p_udesc->user) - 1;
strncpy(p_udesc->user, pwd->pw_name, len);
p_udesc->group[len] = 0;