tvl-depot/users/Profpatsch
Profpatsch ed68ba6751 feat(users/Profpatsch/netencode): ignore earlier record entries
It turns out that the netencode spec requiring to ignore *later*
entries meant that every parser has to do an extra check for each
element, instead of just overriding the key in the hash map.

This leads to a situation where the simple implementation is the wrong
one, which would lead to very subtle problems in parsers (see also the
infamous “json duplicate record entry” problem which has been used for
various exploits in the past).

To be fair, exploits are still possible, but at least a `Map.fromList`
will be the right implementation (provided it folds from the left) now
instead of the wrong one.

Examples of the trivial implementation being now right:

Python:

    > dict([("foo", 1), ("foo", 2)])
    {'foo': 2}

Rust:

    > println!("{:?}", HashMap::from([
      ("foo", 1),
      ("foo", 2)
    ]));
    {"foo": 2}

Haskell:

    > Data.Map.fromList [ ("foo", 1), ("foo", 2) ]
    fromList [("foo",2)]

Change-Id: Ife9593956f4718e5e720f4f348c227e4f3a71e2d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5108
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: Profpatsch <mail@profpatsch.de>
2022-02-14 14:12:19 +00:00
..
advent-of-code/2020 feat(users/Profpatsch/advent-of-code): 2020 day 04 2021-03-01 23:26:25 +00:00
arglib style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
blog style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
emacs-tree-sitter-move style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
execline style(rust): Format all Rust code with rustfmt 2022-02-08 12:06:39 +00:00
git-db style(rust): Format all Rust code with rustfmt 2022-02-08 12:06:39 +00:00
netencode feat(users/Profpatsch/netencode): ignore earlier record entries 2022-02-14 14:12:19 +00:00
netstring style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
nix-home style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
nixpkgs-rewriter style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
struct-edit style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
writers style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
ytextr style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
atomically-write.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
cdb.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
imap-idle.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
imap-idle.rs style(rust): Format all Rust code with rustfmt 2022-02-08 12:06:39 +00:00
lens.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
lib.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
OWNERS feat(users/Profpatsch): add sterni to my user dir OWNERS 2021-02-09 20:46:30 +00:00
read-http.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
read-http.rs style(rust): Format all Rust code with rustfmt 2022-02-08 12:06:39 +00:00
reverse-haskell-deps.hs feat(users/Profpatsch): add reverse-haskell-deps 2021-08-01 16:40:35 +00:00
reverse-haskell-deps.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
tree-sitter.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00