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:	Fri, 22 May 2009 10:22:41 +0800
From:	Zhenwen Xu <helight.xu@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	viro@...iv.linux.org.uk, eparis@...hat.com
Subject: p used before making sure it is not NULL in kernel/auditsc.c

p used before making sure it is not NULL in kernel/auditsc.c

here we should make sure the p is not NULL then use it.



Signed-off-by: Zhenwen Xu <helight.xu@...il.com>
---
 kernel/auditsc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 7d6ac7c..876fdd1 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -341,13 +341,14 @@ static int put_tree_ref(struct audit_context *ctx, struct audit_chunk *chunk)
 {
 	struct audit_tree_refs *p = ctx->trees;
 	int left = ctx->tree_count;
+
+	if (!p)
+		return 0;
 	if (likely(left)) {
 		p->c[--left] = chunk;
 		ctx->tree_count = left;
 		return 1;
 	}
-	if (!p)
-		return 0;
 	p = p->next;
 	if (p) {
 		p->c[30] = chunk;
-- 
1.5.6.5

-- 
--------------------------------
http://zhwen.org - Open and Free
--
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