Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit PR/54281: Jonathan Perkins: NUL terminate rl_lin...



details:   https://anonhg.NetBSD.org/src/rev/1722b42de557
branches:  trunk
changeset: 451847:1722b42de557
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 07 15:21:48 2019 +0000

description:
PR/54281: Jonathan Perkins: NUL terminate rl_line_buffer on modification
to avoid completion leak.

diffstat:

 lib/libedit/readline.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r f62bc4ac05f0 -r 1722b42de557 lib/libedit/readline.c
--- a/lib/libedit/readline.c    Fri Jun 07 15:19:29 2019 +0000
+++ b/lib/libedit/readline.c    Fri Jun 07 15:21:48 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readline.c,v 1.154 2019/06/07 15:19:29 christos Exp $  */
+/*     $NetBSD: readline.c,v 1.155 2019/06/07 15:21:48 christos Exp $  */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.154 2019/06/07 15:19:29 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.155 2019/06/07 15:21:48 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -2237,6 +2237,7 @@
 
        rl_point = (int)(li->cursor - li->buffer);
        rl_end = (int)(li->lastchar - li->buffer);
+       rl_line_buffer[rl_end] = '\0';
 }
 
 void



Home | Main Index | Thread Index | Old Index