Blame SOURCES/0262-lib-file_obj-Don-t-dereference-null-pointers.patch

4b6aa8
From 34b7778028ab60dd3079a2ad3e1df23e87c8708f Mon Sep 17 00:00:00 2001
4b6aa8
From: Ernestas Kulik <ekulik@redhat.com>
4b6aa8
Date: Wed, 29 May 2019 09:17:02 +0200
4b6aa8
Subject: [PATCH] =?UTF-8?q?lib:=20file=5Fobj:=20Don=E2=80=99t=20dereferenc?=
4b6aa8
 =?UTF-8?q?e=20null=20pointers?=
4b6aa8
MIME-Version: 1.0
4b6aa8
Content-Type: text/plain; charset=UTF-8
4b6aa8
Content-Transfer-Encoding: 8bit
4b6aa8
4b6aa8
And, amazingly, someone forgot a semicolon after a return statement in
4b6aa8
such a fix.
4b6aa8
4b6aa8
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
4b6aa8
---
4b6aa8
 src/lib/file_obj.c | 8 ++++++--
4b6aa8
 1 file changed, 6 insertions(+), 2 deletions(-)
4b6aa8
4b6aa8
diff --git a/src/lib/file_obj.c b/src/lib/file_obj.c
4b6aa8
index bbb5b9f..aa973b1 100644
4b6aa8
--- a/src/lib/file_obj.c
4b6aa8
+++ b/src/lib/file_obj.c
4b6aa8
@@ -30,7 +30,7 @@ file_obj_t *new_file_obj(const char* fullpath, const char* filename)
4b6aa8
 void free_file_obj(file_obj_t *f)
4b6aa8
 {
4b6aa8
     if (f == NULL)
4b6aa8
-        return
4b6aa8
+        return;
4b6aa8
 
4b6aa8
     free(f->fullpath);
4b6aa8
     free(f->filename);
4b6aa8
@@ -39,10 +39,14 @@ void free_file_obj(file_obj_t *f)
4b6aa8
 
4b6aa8
 const char *fo_get_fullpath(file_obj_t *fo)
4b6aa8
 {
4b6aa8
+    g_return_val_if_fail(NULL != fo, NULL);
4b6aa8
+
4b6aa8
     return fo->fullpath;
4b6aa8
 }
4b6aa8
 
4b6aa8
 const char *fo_get_filename(file_obj_t *fo)
4b6aa8
 {
4b6aa8
+    g_return_val_if_fail(NULL != fo, NULL);
4b6aa8
+
4b6aa8
     return fo->filename;
4b6aa8
-}
4b6aa8
\ No newline at end of file
4b6aa8
+}
4b6aa8
-- 
4b6aa8
2.21.0
4b6aa8