Follow-up Comment #2, bug #68263 (group screen):

We've had a bug raised in Debian (#1136895) that I think might share the same
root cause.

I can reproduce a stray NUL (`^@`) in status/caption output with `%=` padding,
not only color misrendering.

Minimal screenrc (caption):
  caption always "XXXX%-50=YYYYY"

Minimal screenrc (hardstatus):
  hardstatus alwayslastline 'Left%=%-Lw%{7;4}%n%f %t%{-}%+Lw%=Right'

Observed:
- Occasional bogus char / NUL in output (`^@`)
- Sometimes visible corruption/truncation effects in rendered line

Likely cause is in `src/winmsg.c` (`WINESC_PAD` handling):
After filling padding with `wmbc_putchar()`, code still falls through to the
unconditional `wmbc->p++` at the end of `PadOrTrunc`, which can advance one
byte too far.

A patch was supplied to Debian by Daniel Serpell <[email protected]> -
attached.

Happy to raise a separate bug if I'm wrong!

(file #58623)

    _______________________________________________________

Additional Item Attachment:

Patch from Debian #1136895

Name: fix-uninitialized-buffer-with-padding-escape.patch Size: 774B

<https://file.savannah.gnu.org/file/fix-uninitialized-buffer-with-padding-escape.patch?file_id=58623>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-c36938be85ff6c1b727bc7dd7fd30e48f9142870.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68263>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to