projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80e3c64
)
eina utils: fix build without getpwent.
author
Mykyta Biliavskyi
<m.biliavskyi@samsung.com>
Mon, 20 Feb 2017 09:29:56 +0000
(11:29 +0200)
committer
Mykyta Biliavskyi
<m.biliavskyi@samsung.com>
Mon, 20 Feb 2017 09:29:56 +0000
(11:29 +0200)
If HAVE_GETPWENT isn't defined - the closing brace was missed.
Also prevent situation when strdup() tried to duplicate NULL
pointer, because that could cause segfault.
@fix
src/lib/eina/eina_util.c
patch
|
blob
|
history
diff --git
a/src/lib/eina/eina_util.c
b/src/lib/eina/eina_util.c
index
7205a45
..
1d329d2
100644
(file)
--- a/
src/lib/eina/eina_util.c
+++ b/
src/lib/eina/eina_util.c
@@
-84,12
+84,14
@@
eina_environment_home_get(void)
if (!getpwuid_r(geteuid(), &pwent, pwbuf, sizeof(pwbuf), &pwent2))
{
if ((pwent2) && (pwent.pw_dir))
- home = strdup(pwent.pw_dir);
+ {
+ home = strdup(pwent.pw_dir);
+ return home;
+ }
}
- if (!home) home = strdup("/tmp");
- return home;
- }
# endif
+ home = "/tmp";
+ }
#endif
home = strdup(home);
return home;