Count the noncharacters of every plane as Unshown #6
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/Nostro#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Unshownis the library's list of code points that draw nothing or tell text where to go. Its comment ends the list with "what is no character at all", and the table has those of the first plane (U+FDD0 to U+FDEF, U+FFFE, U+FFFF) and, through the two planes of private use, those of the last two. The noncharacters of the planes between, U+1FFFE and U+1FFFF up to U+EFFFE and U+EFFFF, are not in it.sd-bus refuses a string with any noncharacter. So a name from the bank that holds one of those passes nostrod's
Shown()into the summary of a password dialog, and the question to polkit, which carries the summary as a string, cannot be built: appending it throws, and the caller is answeredInvalidArgument, "text that is not UTF-8 cannot be sent to nostrod". The call fails closed: nobody is asked, and nothing is paid.Found by the pre-push review of 1.0.0 (the bug-prover and security lenses). The table moved from the worker into
Nostro:Utilsin that release, unchanged, so this is older than it.Where
Links are to the tree at
8dd31e2(1.0.0).Unshown:{0xFDD0, 0xFDEF},{0xFFFE, 0xFFFF},{0xE0000, 0xE0FFF}and{0xF0000, 0xFFFFFFFF}, and nothing that holds 0x1FFFE.Shown()leaves out what isUnshown, andAskappends the summary and the details to the question as strings.Plain():(code & 0xFFFE) == 0xFFFE), with a comment saying thatUnshownlacks them.Who can reach it
Not a caller that uses sd-bus, as
Nostro::Clientdoes: it cannot append such a string. Whether nostrod's sd-bus reads one that a client of another library sent was not tried. What is left is text nostrod reads from the bank: an account's name, a counterparty's name on a request or a draft. nlohmann's parser takes a noncharacter as the valid UTF-8 it is.What it would take
Unshowntrue for every code point whose low sixteen bits are FFFE or FFFF, in the function or as ranges in its table.ShouldHandleMoneyAndTextholds the table at the ends of its ranges, and gets the new ones.ShouldServeEveryUsercould show a bank's name with U+1FFFE in a summary without it.Plain()'s own check and its comment can then go.AGENTS.consumer.mddescribesUnshownin a line, which #4 has as inexact already.What was run, and what was read
Run, against libsystemd 262.1:
sd_bus_message_append_basicwith typesreturns-EINVALfor U+1FFFE, U+2FFFF and U+EFFFF, as for U+FFFE and U+FDD0. That a summary with one fails at the question to polkit is from reading the code, not from a run.