summaryrefslogtreecommitdiff
path: root/bin/systrace/policy.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-07-07 23:14:44 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-07-07 23:14:44 +0000
commit73c821c369dfa82196600aeb8c3cf43437742cca (patch)
tree6b0a1ac28d79e69dea6c9a1f61cd9b44f5a47c65 /bin/systrace/policy.c
parent8164b29951f52603c84f0e1450dd19c38f42ae2c (diff)
missing error checks on strdup. from cloder@acm.org
Diffstat (limited to 'bin/systrace/policy.c')
-rw-r--r--bin/systrace/policy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/systrace/policy.c b/bin/systrace/policy.c
index 88a9676b9f9..00b65738cb6 100644
--- a/bin/systrace/policy.c
+++ b/bin/systrace/policy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: policy.c,v 1.11 2002/06/22 18:23:02 deraadt Exp $ */
+/* $OpenBSD: policy.c,v 1.12 2002/07/07 23:14:43 provos Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -460,6 +460,9 @@ systrace_readpolicy(char *filename)
err(1, "%s:%d: calloc", __func__, __LINE__);
filter->rule = strdup(rule);
+ if (filter->rule == NULL)
+ err(1, "%s:%d: strdup", __func__, __LINE__);
+
strlcpy(filter->name, name, sizeof(filter->name));
strlcpy(filter->emulation,emulation,sizeof(filter->emulation));