Module Name:    src
Committed By:   christos
Date:           Fri Jun  7 15:21:48 UTC 2019

Modified Files:
        src/lib/libedit: readline.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/lib/libedit/readline.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.154 src/lib/libedit/readline.c:1.155
--- src/lib/libedit/readline.c:1.154	Fri Jun  7 11:19:29 2019
+++ src/lib/libedit/readline.c	Fri Jun  7 11:21:48 2019
@@ -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_update_pos(void)
 
 	rl_point = (int)(li->cursor - li->buffer);
 	rl_end = (int)(li->lastchar - li->buffer);
+	rl_line_buffer[rl_end] = '\0';
 }
 
 void

Reply via email to