Fixes:
libgst/sysdep/common/files.c:209:11: runtime error: null pointer passed as 
argument 1, which is declared to never be null
---
 libgst/ChangeLog             | 5 +++++
 libgst/sysdep/common/files.c | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/libgst/ChangeLog b/libgst/ChangeLog
index 5daf52ba..9dece1d9 100644
--- a/libgst/ChangeLog
+++ b/libgst/ChangeLog
@@ -1,3 +1,8 @@
+2023-10-29  Holger Hans Peter Freyther  <[email protected]>
+
+       * sysdep/common/files.c: Add NULL checks to _gst_file_is_readable,
+       _gst_file_is_writable and _gst_file_is_executable.
+
 2016-12-30  Lee Duhem  <[email protected]>
 
        * byte.c (_gst_compile_bytecodes): Subtract the free space.
diff --git a/libgst/sysdep/common/files.c b/libgst/sysdep/common/files.c
index 0b40ba8e..685b285a 100644
--- a/libgst/sysdep/common/files.c
+++ b/libgst/sysdep/common/files.c
@@ -206,18 +206,27 @@ _gst_file_is_newer (const char *file1, const char *file2)
 mst_Boolean
 _gst_file_is_readable (const char *fileName)
 {
+  if (!fileName)
+    return false;
+
   return (access (fileName, R_OK) == 0);
 }
 
 mst_Boolean
 _gst_file_is_writeable (const char *fileName)
 {
+  if (!fileName)
+    return false;
+
   return (access (fileName, W_OK) == 0);
 }
 
 mst_Boolean
 _gst_file_is_executable (const char *fileName)
 {
+  if (!fileName)
+    return false;
+
   return (access (fileName, X_OK) == 0);
 }
 
-- 
2.39.3 (Apple Git-145)


Reply via email to