diff options
author | 2007-05-09 13:05:42 +0000 | |
---|---|---|
committer | 2007-05-09 13:05:42 +0000 | |
commit | 15e513b81f89a20f51f79cfc68abe65077d06b2f (patch) | |
tree | b937ce2445f80dcfabb988415509c2b21c4bc35e | |
parent | Truncate the addresses for the deadbeef values so that they don't need (diff) | |
download | wireguard-openbsd-15e513b81f89a20f51f79cfc68abe65077d06b2f.tar.xz wireguard-openbsd-15e513b81f89a20f51f79cfc68abe65077d06b2f.zip |
fix potential NULL deref.
spotted by Ching-Feng Wang <cfw at telepaq.com>.
ok reyk@
-rw-r--r-- | usr.sbin/hoststated/pfe.c | 14 | ||||
-rw-r--r-- | usr.sbin/relayd/pfe.c | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/usr.sbin/hoststated/pfe.c b/usr.sbin/hoststated/pfe.c index bdd57ed623e..08efe112411 100644 --- a/usr.sbin/hoststated/pfe.c +++ b/usr.sbin/hoststated/pfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe.c,v 1.20 2007/03/17 22:46:41 reyk Exp $ */ +/* $OpenBSD: pfe.c,v 1.21 2007/05/09 13:05:42 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -446,9 +446,9 @@ disable_service(struct ctl_conn *c, struct ctl_id *id) service = service_findbyname(env, id->name); else service = service_find(env, id->id); - id->id = service->id; if (service == NULL) return (-1); + id->id = service->id; if (service->flags & F_DISABLE) return (0); @@ -472,9 +472,9 @@ enable_service(struct ctl_conn *c, struct ctl_id *id) service = service_findbyname(env, id->name); else service = service_find(env, id->id); - id->id = service->id; if (service == NULL) return (-1); + id->id = service->id; if (!(service->flags & F_DISABLE)) return (0); @@ -509,9 +509,9 @@ disable_table(struct ctl_conn *c, struct ctl_id *id) table = table_findbyname(env, id->name); else table = table_find(env, id->id); - id->id = table->id; if (table == NULL) return (-1); + id->id = table->id; if ((service = service_find(env, table->serviceid)) == NULL) fatalx("disable_table: desynchronised"); @@ -539,9 +539,9 @@ enable_table(struct ctl_conn *c, struct ctl_id *id) table = table_findbyname(env, id->name); else table = table_find(env, id->id); - id->id = table->id; if (table == NULL) return (-1); + id->id = table->id; if ((service = service_find(env, table->serviceid)) == NULL) fatalx("enable_table: desynchronised"); @@ -571,9 +571,9 @@ disable_host(struct ctl_conn *c, struct ctl_id *id) host = host_findbyname(env, id->name); else host = host_find(env, id->id); - id->id = host->id; if (host == NULL) return (-1); + id->id = host->id; if (host->flags & F_DISABLE) return (0); @@ -613,9 +613,9 @@ enable_host(struct ctl_conn *c, struct ctl_id *id) host = host_findbyname(env, id->name); else host = host_find(env, id->id); - id->id = host->id; if (host == NULL) return (-1); + id->id = host->id; if (!(host->flags & F_DISABLE)) return (0); diff --git a/usr.sbin/relayd/pfe.c b/usr.sbin/relayd/pfe.c index bdd57ed623e..08efe112411 100644 --- a/usr.sbin/relayd/pfe.c +++ b/usr.sbin/relayd/pfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe.c,v 1.20 2007/03/17 22:46:41 reyk Exp $ */ +/* $OpenBSD: pfe.c,v 1.21 2007/05/09 13:05:42 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -446,9 +446,9 @@ disable_service(struct ctl_conn *c, struct ctl_id *id) service = service_findbyname(env, id->name); else service = service_find(env, id->id); - id->id = service->id; if (service == NULL) return (-1); + id->id = service->id; if (service->flags & F_DISABLE) return (0); @@ -472,9 +472,9 @@ enable_service(struct ctl_conn *c, struct ctl_id *id) service = service_findbyname(env, id->name); else service = service_find(env, id->id); - id->id = service->id; if (service == NULL) return (-1); + id->id = service->id; if (!(service->flags & F_DISABLE)) return (0); @@ -509,9 +509,9 @@ disable_table(struct ctl_conn *c, struct ctl_id *id) table = table_findbyname(env, id->name); else table = table_find(env, id->id); - id->id = table->id; if (table == NULL) return (-1); + id->id = table->id; if ((service = service_find(env, table->serviceid)) == NULL) fatalx("disable_table: desynchronised"); @@ -539,9 +539,9 @@ enable_table(struct ctl_conn *c, struct ctl_id *id) table = table_findbyname(env, id->name); else table = table_find(env, id->id); - id->id = table->id; if (table == NULL) return (-1); + id->id = table->id; if ((service = service_find(env, table->serviceid)) == NULL) fatalx("enable_table: desynchronised"); @@ -571,9 +571,9 @@ disable_host(struct ctl_conn *c, struct ctl_id *id) host = host_findbyname(env, id->name); else host = host_find(env, id->id); - id->id = host->id; if (host == NULL) return (-1); + id->id = host->id; if (host->flags & F_DISABLE) return (0); @@ -613,9 +613,9 @@ enable_host(struct ctl_conn *c, struct ctl_id *id) host = host_findbyname(env, id->name); else host = host_find(env, id->id); - id->id = host->id; if (host == NULL) return (-1); + id->id = host->id; if (!(host->flags & F_DISABLE)) return (0); |