From 21ca0315598f3537c8c2edd01ae7c39c343a6e73 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 1 Oct 2013 17:15:08 +0200 Subject: [PATCH] pylibmount: make tab parsers more robust [coverity scan] Signed-off-by: Karel Zak --- libmount/python/context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmount/python/context.c b/libmount/python/context.c index ce7711b3f2..408c8bd759 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); } -- 2.47.3