Project

General

Profile

Actions

Bug #13606

closed

tic(1) writes uninitialized data to some terminfo entries

Added by Rich Lowe about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

I tripped wsdiff in the nansi.sysk terminfo entry, it turns out to be because for dubious reasons tic(1) avoids offsets of 255 stating that "Vr2 binaries read it as -1", and in doing so will write a junk byte between the trailing NUL of the previous string table entry,
and the start of the current one, tripping wsdiff. It should write a NUL instead.

Probably, the paranoia around 255 is unwarranted, but that's going to come up in consumers and is likely not worth the testing load.
(even more probably, we should just use the ncurses tic(1), but that has the same testing load of making sure our 3 other curses libraries are ok with it)

Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1309
Actions #2

Updated by Rich Lowe about 1 year ago

Tested with diffs of infocmp(1) output, valgrind to check the uninitialized memory was no longer written.

; (for elt in **/*(.); diff -u <(env TERMINFO=/usr/share/lib/terminfo infocmp ${elt:t} | grep -v '^#') <(env TERMINFO=$PWD infocmp ${elt:t} | grep -v '^#')) | head
Actions #3

Updated by Electric Monk about 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 2587b3a0593a431a99cc2dc78bf1034e672a35e2

commit  2587b3a0593a431a99cc2dc78bf1034e672a35e2
Author: Richard Lowe <richlowe@richlowe.net>
Date:   2021-03-09T20:57:24.000Z

    13606 tic(1) writes uninitialized data to some terminfo entries
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Jason King <jason.brian.king+illumos@gmail.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF