diff options
author | Karel Zak | 2013-10-01 17:15:08 +0200 |
---|---|---|
committer | Karel Zak | 2013-10-01 17:15:08 +0200 |
commit | 21ca0315598f3537c8c2edd01ae7c39c343a6e73 (patch) | |
tree | cb16becb7935b50583f31e4ab89ba3c5a9b65171 /libmount/python | |
parent | utmpdump: make analyzers happy (diff) | |
download | kernel-qcow2-util-linux-21ca0315598f3537c8c2edd01ae7c39c343a6e73.tar.gz kernel-qcow2-util-linux-21ca0315598f3537c8c2edd01ae7c39c343a6e73.tar.xz kernel-qcow2-util-linux-21ca0315598f3537c8c2edd01ae7c39c343a6e73.zip |
pylibmount: make tab parsers more robust [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/python')
-rw-r--r-- | libmount/python/context.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmount/python/context.c b/libmount/python/context.c index ce7711b3f..408c8bd75 100644 --- a/libmount/python/context.c +++ b/libmount/python/context.c @@ -854,8 +854,7 @@ static PyObject *Context_get_fstab(ContextObjext *self) { struct libmnt_table *tab = NULL; - mnt_context_get_fstab(self->cxt, &tab); - if (!tab) + if (mnt_context_get_fstab(self->cxt, &tab) != 0 || !tab) return NULL; return PyObjectResultTab(tab); } @@ -864,7 +863,8 @@ static PyObject *Context_get_mtab(ContextObjext *self) { struct libmnt_table *tab = NULL; - mnt_context_get_mtab(self->cxt, &tab); + if (mnt_context_get_mtab(self->cxt, &tab) != 0 || !tab) + return NULL; return PyObjectResultTab(tab); } |