From 884b94759999756ef7800773653660f27915ca96 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 14 May 2003 04:16:06 +0000 Subject: correct bound length and make sure string is always nul'd fixes problem found by markus@ --- gnu/lib/libreadline/histexpand.c | 2 +- gnu/lib/libreadline/isearch.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'gnu/lib') diff --git a/gnu/lib/libreadline/histexpand.c b/gnu/lib/libreadline/histexpand.c index 4c42a213c0e..30c8f913379 100644 --- a/gnu/lib/libreadline/histexpand.c +++ b/gnu/lib/libreadline/histexpand.c @@ -847,7 +847,7 @@ history_expand (hstring, output) string[0] = string[1] = history_expansion_char; string[2] = ':'; string[3] = 's'; - strlcpy (string + 4, hstring, l - 4); + strlcpy (string + 4, hstring, l + 1); l += 4; } else diff --git a/gnu/lib/libreadline/isearch.c b/gnu/lib/libreadline/isearch.c index be051203335..53bbface2f6 100644 --- a/gnu/lib/libreadline/isearch.c +++ b/gnu/lib/libreadline/isearch.c @@ -110,6 +110,7 @@ rl_display_search (search_string, reverse_p, where) #endif /* NOTDEF */ message[msglen++] = '('; + message[msglen] = '\0'; if (reverse_p) { -- cgit v1.2.3