about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Src/utils.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index dbdb22319..418d922ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-07-23  Peter Stephenson  <p.stephenson@samsung.com>
 
+	* 35872: Src/utils.c: protect against NULL pointers in unmeta().
+
 	* 35849: Src/exec.c, Src/jobs.c, Test/D03procsubst.ztst: close
 	file descriptors from process substitution in parent after
 	fork.
diff --git a/Src/utils.c b/Src/utils.c
index ba9056459..0acab88ff 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -4401,7 +4401,10 @@ unmeta(const char *file_name)
     char *p;
     const char *t;
     int newsz, meta;
-    
+
+    if (!file_name)
+	return NULL;
+
     meta = 0;
     for (t = file_name; *t; t++) {
 	if (*t == Meta)