From 857a89e4bd34961df67fdb47edfbcc3552bc9083 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Mon, 12 Mar 2018 07:31:28 -0500 Subject: [PATCH] fixup! Fix oob memory access in expand's call to `trim()` --- src/expand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expand.cpp b/src/expand.cpp index 1409f3bde..bf57451ff 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -937,7 +937,7 @@ static expand_error_t expand_braces(const wcstring &instr, expand_flags_t flags, assert(pos >= item_begin); size_t item_len = pos - item_begin; wcstring item = wcstring(item_begin, item_len); - item = trim(item, (const wchar_t[]) { BRACE_SPACE, nullptr }); + item = trim(item, (const wchar_t[]) { BRACE_SPACE, L'\0' }); for (auto &c : item) { if (c == BRACE_SPACE) { c = ' ';