wget/src-utils.ci-file_exists_p-Fix-stat-NULL.patch

27 lines
657 B
Diff
Raw Normal View History

2019-09-30 11:19:50 -04:00
From 4bdb09d3a705c550a594f837124a8c20b89d98b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
Date: Wed, 9 May 2018 12:37:03 +0200
Subject: [PATCH 08/83] * src/utils.ci (file_exists_p): Fix stat(NULL,...)
---
src/utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/utils.c b/src/utils.c
index ec55f2e0..0cb905ad 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -563,6 +563,9 @@ file_exists_p (const char *filename, file_stats_t *fstats)
{
struct stat buf;
+ if (!filename)
+ return false;
+
#if defined(WINDOWS) || defined(__VMS)
int ret = stat (filename, &buf);
if (ret >= 0)
--
2.19.1