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-prev] [day] [month] [year] [list]
Date:	Sun, 21 Sep 2014 15:37:40 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Cc:	Theodore Ts'o <tytso@....edu>
Subject: [PATCH 2/2] libext2fs: use ~0UL instead of -1UL to avoid static checker warnings

Signed-off-by: Theodore Ts'o <tytso@....edu>
---
 lib/ext2fs/ext2fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
index d931fff..fef6910 100644
--- a/lib/ext2fs/ext2fs.h
+++ b/lib/ext2fs/ext2fs.h
@@ -1712,7 +1712,7 @@ _INLINE_ errcode_t ext2fs_get_memzero(unsigned long size, void *ptr)
 
 _INLINE_ errcode_t ext2fs_get_array(unsigned long count, unsigned long size, void *ptr)
 {
-	if (count && (-1UL)/count<size)
+	if (count && (~0UL)/count < size)
 		return EXT2_ET_NO_MEMORY;
 	return ext2fs_get_mem(count*size, ptr);
 }
@@ -1722,7 +1722,7 @@ _INLINE_ errcode_t ext2fs_get_arrayzero(unsigned long count,
 {
 	void *pp;
 
-	if (count && (-1UL)/count<size)
+	if (count && (~0UL)/count < size)
 		return EXT2_ET_NO_MEMORY;
 	pp = calloc(count, size);
 	if (!pp)
-- 
2.1.0

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ