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:	Wed, 25 Jun 2014 10:46:39 +0200
From:	Rasmus Villemoes <linux@...musvillemoes.dk>
To:	Rusty Russell <rusty@...tcorp.com.au>,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org,
	Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH] scripts/mod/modpost.c: Fix bug in number_prefix

The function number_prefix() can currently only return 1 if its
argument is the empty string: If line 3 is reached and *sym (now the
second character in the argument) is not '.', 0 is returned. However,
if that character is '.', the first assignment to c is that same '.',
which obviously fails to be a digit.

Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
 scripts/mod/modpost.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 9d9c5b9..336f45f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -778,9 +778,9 @@ static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr)
  */
 static int number_prefix(const char *sym)
 {
-	if (*sym++ == '\0')
+	if (*sym == '\0')
 		return 1;
-	if (*sym != '.')
+	if (*sym++ != '.')
 		return 0;
 	do {
 		char c = *sym++;
-- 
1.9.2

--
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