Skip to content

Commit 69c8f94

Browse files
authored
Merge pull request #91 from rofinn/rf/libc-null-checks
Add some C_NULL checks for our libc calls
2 parents 2da225e + ad3249e commit 69c8f94

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libc.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function User(name::String)
7373
Cpasswd()
7474
end
7575

76+
systemerror(:getpwnam, ps == C_NULL)
7677
User(ps)
7778
end
7879

@@ -83,6 +84,7 @@ function User(uid::UInt)
8384
Cpasswd()
8485
end
8586

87+
systemerror(:getpwuid, ps == C_NULL)
8688
User(ps)
8789
end
8890

@@ -110,6 +112,7 @@ function Group(name::String)
110112
Cgroup()
111113
end
112114

115+
systemerror(:getgrnam, ps == C_NULL)
113116
Group(ps)
114117
end
115118

@@ -120,6 +123,7 @@ function Group(gid::UInt)
120123
Cgroup()
121124
end
122125

126+
systemerror(:getgrgid, gr == C_NULL)
123127
Group(gr)
124128
end
125129

0 commit comments

Comments
 (0)