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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 21 Apr 2012 17:25:42 +0800
From:	yan <clouds.yan@...il.com>
To:	greg <gregkh@...uxfoundation.org>
Cc:	kernel <linux-kernel@...r.kernel.org>,
	message <message.get@...il.com>
Subject: [PATCH 1/4][Trivial] lib/kobject.c: Check parameter in
 kobject_get_path

kobject_get_path is exported, it passes its parameter kobj to
get_kobj_path_length and fill_kobj_path which are both static 
and called only once here. So check this parameter.


Signed-off-by: Yan Hong <clouds.yan@...il.com>
---
 lib/kobject.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/kobject.c b/lib/kobject.c
index 38fcc60..56c8cb3 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -104,6 +104,9 @@ char *kobject_get_path(struct kobject *kobj, gfp_t gfp_mask)
 	char *path;
 	int len;
 
+	if (!kobj)
+		return NULL;
+
 	len = get_kobj_path_length(kobj);
 	if (len == 0)
 		return NULL;
-- 
1.7.5.1



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