summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e
diff options
context:
space:
mode:
authorjedgar <jedgar@FreeBSD.org>2002-02-21 23:13:06 +0000
committerjedgar <jedgar@FreeBSD.org>2002-02-21 23:13:06 +0000
commit6452c2e85d04e3efcaffbbd49b4c693d65e8c0ef (patch)
tree6e00b3823026644f447123b44689f43399e9f057 /lib/libc/posix1e
parent7b5185bd4c846fe62daaf852a72d061dff3af9f0 (diff)
downloadFreeBSD-src-6452c2e85d04e3efcaffbbd49b4c693d65e8c0ef.zip
FreeBSD-src-6452c2e85d04e3efcaffbbd49b4c693d65e8c0ef.tar.gz
Add more argument checking
Reviewed by: rwatson Obtained from: TrustedBSD Project
Diffstat (limited to 'lib/libc/posix1e')
-rw-r--r--lib/libc/posix1e/acl_set.c4
-rw-r--r--lib/libc/posix1e/acl_valid.c13
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/libc/posix1e/acl_set.c b/lib/libc/posix1e/acl_set.c
index 6b7dded..39fa3a9 100644
--- a/lib/libc/posix1e/acl_set.c
+++ b/lib/libc/posix1e/acl_set.c
@@ -51,6 +51,10 @@ acl_set_file(const char *path_p, acl_type_t type, acl_t acl)
{
int error;
+ if (acl == NULL || path_p == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
if (_posix1e_acl(acl, type)) {
error = _posix1e_acl_sort(acl);
if (error) {
diff --git a/lib/libc/posix1e/acl_valid.c b/lib/libc/posix1e/acl_valid.c
index 6eaa6ac..e8d2df7 100644
--- a/lib/libc/posix1e/acl_valid.c
+++ b/lib/libc/posix1e/acl_valid.c
@@ -34,6 +34,7 @@
#include <sys/acl.h>
#include "un-namespace.h"
#include <sys/errno.h>
+#include <stdlib.h>
#include "acl_support.h"
@@ -54,6 +55,10 @@ acl_valid(acl_t acl)
{
int error;
+ if (acl == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
_posix1e_acl_sort(acl);
error = _posix1e_acl_check(acl);
if (error) {
@@ -70,6 +75,10 @@ acl_valid_file_np(const char *pathp, acl_type_t type, acl_t acl)
{
int error;
+ if (pathp == NULL || acl == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
if (_posix1e_acl(acl, type)) {
error = _posix1e_acl_sort(acl);
if (error) {
@@ -87,6 +96,10 @@ acl_valid_fd_np(int fd, acl_type_t type, acl_t acl)
{
int error;
+ if (acl == NULL) {
+ errno = EINVAL;
+ return (-1);
+ }
if (_posix1e_acl(acl, type)) {
error = _posix1e_acl_sort(acl);
if (error) {
OpenPOWER on IntegriCloud