lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 27 Oct 2007 16:19:57 +0200
From:	Adrian Bunk <bunk@...nel.org>
To:	David Howells <dhowells@...hat.com>
Cc:	linux-kernel@...r.kernel.org
Subject: [2.6 patch] fs/afs/vlocation.c: fix off-by-one

This patch fixes an off-by-one error spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@...nel.org>

---
d88aac5aa6057a8d784934dc5035e9e853b16203 
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 7b4bbe4..849fc31 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -376,19 +376,19 @@ struct afs_vlocation *afs_vlocation_lookup(struct afs_cell *cell,
 					   size_t namesz)
 {
 	struct afs_vlocation *vl;
 	int ret;
 
 	_enter("{%s},{%x},%*.*s,%zu",
 	       cell->name, key_serial(key),
 	       (int) namesz, (int) namesz, name, namesz);
 
-	if (namesz > sizeof(vl->vldb.name)) {
+	if (namesz >= sizeof(vl->vldb.name)) {
 		_leave(" = -ENAMETOOLONG");
 		return ERR_PTR(-ENAMETOOLONG);
 	}
 
 	/* see if we have an in-memory copy first */
 	down_write(&cell->vl_sem);
 	spin_lock(&cell->vl_lock);
 	list_for_each_entry(vl, &cell->vl_list, link) {
 		if (vl->vldb.name[namesz] != '\0')

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ