]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/sysfs: check if cxt->dir_path is NULL in sysfs_readlink()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 20 Jun 2012 08:32:00 +0000 (16:32 +0800)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Jun 2012 06:21:23 +0000 (08:21 +0200)
commitcffee0de0cf7c0d44323a830beb313d5ae18247d
treec5e52c83a05cd8b4dd7aba9e2deed31e9a12eb7a
parent95f9f3098ec274d7d50a0bd57f6afdf62e7bb109
lib/sysfs: check if cxt->dir_path is NULL in sysfs_readlink()

cxt->dir_path could be NULL, for example, when sysfs_init() fails,
check this before calling readlink()/readlink_at().

Cc: Karel Zak <kzak@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
lib/sysfs.c