From 8e6ab9f8012ff54d2e3cf2804db811e5f8eada1b Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Mon, 18 Feb 2019 12:52:53 +0100 Subject: [PATCH] Properly end string to make sure ecpglib does not read beyond its boundaries. --- src/interfaces/ecpg/ecpglib/execute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 67681956b0..0c147b77cc 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1072,8 +1072,9 @@ print_param_value(char *value, int len, int is_binary, int lineno, int nth) value_s = value; else { - value_s = ecpg_alloc(ecpg_hex_enc_len(len), lineno); + value_s = ecpg_alloc(ecpg_hex_enc_len(len)+1, lineno); ecpg_hex_encode(value, len, value_s); + value_s[ecpg_hex_enc_len(len)] = '\0'; malloced = true; } -- 2.40.0