From cff431d2d905e25197cf3c471c5131736381ef1d Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 30 Jul 2018 13:26:25 +0000 Subject: tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string literal. 2018-07-30 Bernd Edlinger * tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string literal. From-SVN: r263068 --- gcc/tree-ssa-forwprop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-ssa-forwprop.c') diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 2efb5ac..5607811 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -1391,7 +1391,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2) src_buf, ptr1_align, false)) break; - new_str_cst = build_string_literal (src_len, src_buf); + new_str_cst = build_string_literal (src_len + 1, src_buf); if (callee1) { /* If STMT1 is a mem{,p}cpy call, adjust it and remove -- cgit v1.1