diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2012-12-20 05:37:06 +0900 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2012-12-20 05:49:54 +0900 |
commit | 4f0e3c16aa7d2dd656bcc167052b64dd34a04428 (patch) | |
tree | b957160da1d51016a18e5d55446c298f83474961 /ninfod | |
parent | 3fc2932d6c646677530a31fd41078a8bf1f2b170 (diff) | |
download | iputils-4f0e3c16aa7d2dd656bcc167052b64dd34a04428.tar.gz |
ninfod: Fix off-by-one error to check possible programming error (again).
This bug was once fixed by commit 70bcae85 ("ninfod: Fix off-by-one
error to check possible programming error."), but unfotunately, it was
re-introduced by commit 9a2a2664 ("ninfod: Introduce ARRAY_SIZE macro
for counting number of elements in an array.").
Bug noticed by Jan Synacek <jsynacek@redhat.com>.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'ninfod')
-rw-r--r-- | ninfod/ninfod_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ninfod/ninfod_core.c b/ninfod/ninfod_core.c index f411a7a..389f5c0 100644 --- a/ninfod/ninfod_core.c +++ b/ninfod/ninfod_core.c @@ -314,7 +314,7 @@ void init_nodeinfo_suptypes(INIT_ARGS) qtype = qtypeinfo_table[i].qtype; w = qtype>>5; b = qtype&0x1f; - if (w > ARRAY_SIZE(suptypes)) { + if (w >= ARRAY_SIZE(suptypes)) { /* This is programming error. */ DEBUG(LOG_ERR, "Warning: Too Large Supported Types\n"); exit(1); |