about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/utils.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e37557df..61702caa8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-12-30  dana  <dana@dana.is>
+
+	* unposted (per 43938): Src/utils.c: Avoid segfault when
+	unmetafying empty string
+
 2018-12-29  dana  <dana@dana.is>
 
 	* 43953 (tweaked per 43954): Src/utils.c, Test/V09datetime.ztst:
diff --git a/Src/utils.c b/Src/utils.c
index 0969cef37..32f600858 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3846,7 +3846,7 @@ sepjoin(char **s, char *sep, int heap)
     char sepbuf[2];
 
     if (!*s)
-	return heap ? "" : ztrdup("");
+	return heap ? dupstring("") : ztrdup("");
     if (!sep) {
 	/* optimise common case that ifs[0] is space */
 	if (ifs && *ifs != ' ') {