summaryrefslogtreecommitdiffstats
path: root/libmount/python
diff options
context:
space:
mode:
authorKarel Zak2013-10-01 17:15:08 +0200
committerKarel Zak2013-10-01 17:15:08 +0200
commit21ca0315598f3537c8c2edd01ae7c39c343a6e73 (patch)
treecb16becb7935b50583f31e4ab89ba3c5a9b65171 /libmount/python
parentutmpdump: make analyzers happy (diff)
downloadkernel-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.c6
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);
}