Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144935756
D55172.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
904 B
Referenced Files
None
Subscribers
None
D55172.diff
View Options
diff --git a/libexec/flua/modules/lposix.c b/libexec/flua/modules/lposix.c
--- a/libexec/flua/modules/lposix.c
+++ b/libexec/flua/modules/lposix.c
@@ -100,11 +100,11 @@
owner = (uid_t)lua_tointeger(L, 2);
else if (lua_isstring(L, 2)) {
char buf[4096];
- struct passwd passwd, *pwd;
+ struct passwd passwd, *pwd = NULL;
error = getpwnam_r(lua_tostring(L, 2), &passwd,
buf, sizeof(buf), &pwd);
- if (error == 0)
+ if (pwd != NULL && error == 0)
owner = pwd->pw_uid;
else
return (luaL_argerror(L, 2,
@@ -121,11 +121,11 @@
group = (gid_t)lua_tointeger(L, 3);
else if (lua_isstring(L, 3)) {
char buf[4096];
- struct group gr, *grp;
+ struct group gr, *grp = NULL;
error = getgrnam_r(lua_tostring(L, 3), &gr, buf, sizeof(buf),
&grp);
- if (error == 0)
+ if (grp != NULL && error == 0)
group = grp->gr_gid;
else
return (luaL_argerror(L, 3,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 15, 7:02 AM (13 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28603052
Default Alt Text
D55172.diff (904 B)
Attached To
Mode
D55172: flua: Fix SIGSEGV in lua_chown when uid/gid doesn't exist
Attached
Detach File
Event Timeline
Log In to Comment