diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-05-14 04:16:06 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-05-14 04:16:06 +0000 |
commit | 884b94759999756ef7800773653660f27915ca96 (patch) | |
tree | 48e10d08e6779b9bccde45bfa717ce6423cf556c | |
parent | beb2ab13d49e1b36e620b36584d16eca556cb326 (diff) |
correct bound length and make sure string is always nul'd
fixes problem found by markus@
-rw-r--r-- | gnu/lib/libreadline/histexpand.c | 2 | ||||
-rw-r--r-- | gnu/lib/libreadline/isearch.c | 1 |
2 files changed, 2 insertions, 1 deletions
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) { |