Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/ftp/gftp/files/patch-lib-misc.c
16151 views
1
Fix segmentation fault, when gftpui_run_chdir is called with directory=0x0,
2
and then calls gftp_expand_path (src=0x0),
3
the NULL string was cloned using g_strdup, which returns NULL if
4
its only argument is NULL, then this returned string was unreferenced.
5
6
lib/misc.c | 2 ++
7
1 files changed, 2 insertions(+), 0 deletions(-)
8
9
diff --git a/lib/misc.c b/lib/misc.c
10
index 16c019b..2791466 100644
11
--- lib/misc.c.orig
12
+++ lib/misc.c
13
@@ -143,6 +143,8 @@ gftp_expand_path (gftp_request * request, const char *src)
14
tempchar;
15
struct passwd *pw;
16
17
+ g_return_val_if_fail(src != NULL, NULL);
18
+
19
pw = NULL;
20
str = g_strdup (src);
21
22
23