Pasting clipboard content in Firefox appends U+0000 null characters — occurs with Windows echo text | clip and PowerPro clip.set("text")
Categories
(Core :: Widget: Win32, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr128 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox139 | --- | unaffected |
| firefox140 | + | disabled |
| firefox141 | + | disabled |
People
(Reporter: fraster, Assigned: handyman)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
dmeehan
:
approval-mozilla-release+
|
Details | Review |
Steps to reproduce:
in Windows execute
echo text|clip
or
in powerpro
clipset("text"
Actual results:
Paste the clipboard content into in input of url bar field using right-click → Paste then input field contains: "test" that includes 4 null bytes (0x00 0x00 0x00 0x00) as padding or terminator
Expected results:
input field contains: "test" without extra character
Comment 2•6 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Copy & Paste and Drag & Drop' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•6 months ago
|
||
I can reproduce the issue on Nightly141.0a1 Windows11.
Regression window:
https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=d74aee22f0ac3d2462dc623d35274e5701e054e1&tochange=a7594596cdb1b28f26589d2a1113f767837ac2b0
Comment 4•6 months ago
|
||
:handyman, since you are the author of the regressor, bug 1966443, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 7•6 months ago
|
||
I'll just remove all of the null bytes at the end of the string (modulo Word's stray LF). This means that Windows will behave differently than Linux and Mac but I guess they don't have the same tradition of applications putting garbage on the clipboard. To recount:
- The clipboard docs say that the clipboard data is terminated by a null byte, despite it having a separate length value. This belief was presumably the origin of the original code, and was therefore the cause of bug 1966443.
- To fix that, we ignored docs and used the count, but removed the last char if it was null because "a lot of things were appending a null". So that was already a hack to get around bad clipboard contents.
- That led to bug 1968267 -- Word was appending a null followed by a line feed to its contents. So we started also skipping that 2 byte combination as well.
- This bug is about other apps (like the terminal piping output to the clipboard) adding streams of nulls to the end of their byte count. So we'll ignore that, too. We could probably use the solution that bug 1852790 comment 9 says Chrome uses, of removing all nulls, but that's further from our Linux and Mac implementations and is more severe.
Updated•6 months ago
|
| Assignee | ||
Comment 8•6 months ago
|
||
We previously removed (0x00 0x0a | 0x00)? from the end of the contents.
We now remove (0x00 0x0a)? from the end, and any 0x00 found anywhere in the
contents.
| Assignee | ||
Comment 9•6 months ago
|
||
We previously removed (0x00 0x0a|0x00)?. We now remove (0x00)*(0x00 0x0a)?.
| Assignee | ||
Comment 10•6 months ago
|
||
We'll choose one of these.
Updated•6 months ago
|
Comment 11•6 months ago
|
||
Comment 12•6 months ago
|
||
| bugherder | ||
Comment 13•6 months ago
|
||
The patch landed in nightly and beta is affected.
:handyman, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox140towontfix.
For more information, please visit BugBot documentation.
Comment 14•5 months ago
|
||
We previously removed (0x00 0x0a|0x00)?. We now remove (0x00)*(0x00 0x0a)?.
Original Revision: https://phabricator.services.mozilla.com/D252588
Updated•5 months ago
|
Comment 15•5 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: extra characters at the end of pasted strings from some Windows applications
- Code covered by automated testing: no
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: n/a
- Risk associated with taking this patch: low
- Explanation of risk level: Just stripping NULLs and the NULL/LF combo from the end of pasted strings
- String changes made/needed: no
- Is Android affected?: no
Updated•5 months ago
|
Updated•5 months ago
|
Comment 16•5 months ago
|
||
| uplift | ||
Comment 17•5 months ago
|
||
| uplift | ||
Comment 18•5 months ago
|
||
Comment 19•5 months ago
|
||
Backed out from beta, as part of backing out the regressor Bug 1966443
Comment 20•5 months ago
|
||
Backout merged into central: https://hg-edge.mozilla.org/mozilla-central/rev/bcb64d8b5ed5235d0a8f95038616faec8b107224
Updated•5 months ago
|
| Assignee | ||
Updated•5 months ago
|
Updated•4 months ago
|
| Assignee | ||
Comment 21•4 months ago
|
||
Fixed by backout
Updated•4 months ago
|
Description
•