From 6d044f7858455565019fca9ca166a1289a87b5f5 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 2 Mar 2011 12:10:13 +0100 Subject: [PATCH] --- yaml --- r: 233859 b: refs/heads/master c: 9ef0298a8e5730d9a46d640014c727f3b4152870 h: refs/heads/master i: 233857: be25f936f78431bef42a966f4b6ffb08272b79f3 233855: 55d59319e3edd568fa79e56642aab93a13214538 v: v3 --- [refs] | 2 +- trunk/net/netfilter/nf_log.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index aac3ab30479e..d1b3415bfe01 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ff75f40f44ae9b79d520bf32a05d35af74a805c0 +refs/heads/master: 9ef0298a8e5730d9a46d640014c727f3b4152870 diff --git a/trunk/net/netfilter/nf_log.c b/trunk/net/netfilter/nf_log.c index b07393eab88e..91816998ed86 100644 --- a/trunk/net/netfilter/nf_log.c +++ b/trunk/net/netfilter/nf_log.c @@ -85,6 +85,8 @@ EXPORT_SYMBOL(nf_log_unregister); int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger) { + if (pf >= ARRAY_SIZE(nf_loggers)) + return -EINVAL; mutex_lock(&nf_log_mutex); if (__find_logger(pf, logger->name) == NULL) { mutex_unlock(&nf_log_mutex); @@ -98,6 +100,8 @@ EXPORT_SYMBOL(nf_log_bind_pf); void nf_log_unbind_pf(u_int8_t pf) { + if (pf >= ARRAY_SIZE(nf_loggers)) + return; mutex_lock(&nf_log_mutex); rcu_assign_pointer(nf_loggers[pf], NULL); mutex_unlock(&nf_log_mutex);