Package: dialog
Version: 1.3-20201126-1
Severity: normal

Dear Maintainer,

The --max-input option seems to ignore values higher than 2048, which
is the default limit according to the man page. This means that we
cannot pass lines to the editbox widget that are longer than 2047
characters since they get truncated. One such use case is base64-encoded
data.

Steps to reproduce:
1. Create 2050-character input string:
   # echo -n $(openssl rand -hex 1025) > /tmp/input && cat /tmp/input | wc -c
   2050

2. Run dialog with an input limit higher than 2048 (e.g., 2060):
   # touch /tmp/foo && dialog --max-input 2060 --output-separator '' --editbox 
/tmp/foo 18 80 2>/tmp/output

3. Copy the input string from /tmp/input into your clipboard and paste
   it into the editbox.

4. Press the "OK" button.

5. Inspect the length of the output string.
   # cat /tmp/output | wc -c
   2047

Expected behavior: length of output string == 2050 (== length of input string)
Actual behavior:   length of output string == 2047 (== <default --max-input> - 
1)

When setting --max-input to values lower than 2048 though, it works as
expected.


-- System Information:
Debian Release: 9.13
  APT prefers stable
  APT policy: (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.4.0-91-generic (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8), LANGUAGE=en_US.UTF-8
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages dialog depends on:
ii  debianutils   4.8.1.1
ii  libc6         2.31-13+deb11u2
ii  libncursesw6  6.2+20201114-2
ii  libtinfo6     6.2+20201114-2

dialog recommends no packages.

dialog suggests no packages.

-- no debconf information

Reply via email to