https://bugs.kde.org/show_bug.cgi?id=523990
Bug ID: 523990
Summary: First paste into a no-echo/getpass prompt inserts an
extra leading NUL character
Classification: Applications
Product: konsole
Version First 26.04.3
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: copy-paste
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
First paste into getpass prompt inserts an extra leading null character
STEPS TO REPRODUCE
1. Launch konsole
2. Run capture and compare password check:
python3 - <<'PY'
import getpass
a = getpass.getpass("First: ")
b = getpass.getpass("Second: ")
print("same:", a == b)
print("lengths:", len(a), len(b))
if len(a) != len(b):
for i in range(min(len(a), len(b))):
if a[i] != b[i]:
print("first difference:", i, ord(a[i]), ord(b[i]))
break
PY
3. copy a password or string to your clipboard, then paste it into the above
running tool, it will report same as false then show the lengths of the first
and second pasted password, the first paste having 1 character more
4. Run again without copying the password or string again and it will give the
correct matching result despite no change to the copy buffer
OBSERVED RESULT
Password length changes for the same copy buffer for the first paste,
subsequent second paste operations report correctly.
Example output on first try:
same: False
lengths: 46 45
first difference: 0 0 57
Example output on second try without changing copy buffer:
same: True
lengths: 45 45
first code: 57
same = whether the strings match
length = length of first paste, length of second paste
first difference = shows the position where the two pasted values first become
different, and the numeric value of the character found at that position in
each paste
EXPECTED RESULT
Password length/content stays the same for every paste attempt, doesn't
introduce extra characters on the first paste
SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a
terminal window): KDE neon User Edition
KDE Plasma Version: 6.7.3
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1
konsole version: 26.04.3
ADDITIONAL INFORMATION
Using a different terminal (pycharm integrated terminal), works as expected
each time.
Unrelated to the bug report:
This is my first issue reporting to this platform, hoping it's helpful,
extremely grateful for all the hard work into making kde software.
The behaviour is very unusual and took me far longer than I'd like to admit to
track down the issue, as you can imagine, trying to enter passwords and having
just the first paste do something different was very easy to overlook (and
frustrating)!
Thanks for all the hard work!
--
You are receiving this mail because:
You are watching all bug changes.