From: Karel Zak Date: Mon, 30 Jan 2012 22:55:26 +0000 (+0100) Subject: libmount: make iter reset more robust [coverity scan] X-Git-Tag: v2.21-rc2~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0113a20e933c4ecf903db6fe8e442f6581d8bdba;p=thirdparty%2Futil-linux.git libmount: make iter reset more robust [coverity scan] Signed-off-by: Karel Zak --- diff --git a/libmount/src/iter.c b/libmount/src/iter.c index 99fedd17b8..393c23eb28 100644 --- a/libmount/src/iter.c +++ b/libmount/src/iter.c @@ -56,7 +56,7 @@ void mnt_reset_iter(struct libmnt_iter *itr, int direction) { assert(itr); - if (direction == -1) + if (direction == -1 && itr) direction = itr->direction; if (itr) {