bug-ncurses
[Top][All Lists]
Advanced

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

Small change to _nc_write_entry


From: Sven Joachim
Subject: Small change to _nc_write_entry
Date: Sun, 11 Feb 2018 09:28:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux)

In the 20171125 patchlevel, a limit2 variable was introduced in the
_nc_write_entry function.  Julien Cristau has pointed out[1] that there
is a place where it probably should be used, but is not.

diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c
index cc3f83ac..c8027156 100644
--- a/ncurses/tinfo/write_entry.c
+++ b/ncurses/tinfo/write_entry.c
@@ -377,7 +377,7 @@ _nc_write_entry(TERMTYPE2 *const tp)
        start_time = 0;
     }
 
-    if (strlen(first_name) >= sizeof(filename) - (2 + LEAF_LEN)) {
+    if (strlen(first_name) >= limit2) {
        _nc_warning("terminal name too long.");
        saved = first_name[limit2];
        first_name[limit2] = '\0';
Cheers,
       Sven


1. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885582#15

reply via email to

[Prev in Thread] Current Thread [Next in Thread]