This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Passing null/undefined for options crashes node #1574
Labels
exp/novice
Someone with a little familiarity can pick up
kind/bug
A bug in existing code (including security flaws)
P1
High: Likely tackled by core team if no one steps up
It's legal to pass
null
/undefined
as a value for options. In some instances our API methods expect an options object to exist and try to access properties on it, which fails and crashes the node.e.g.
js-ipfs/src/core/components/files.js
Lines 279 to 281 in e7d1270
^^ in this instance, the default assignment only happens if options is
undefined
so does not work correctly ifnull
is passed.It could happen if the user is using a ternary to pass/not pass options e.g.
The text was updated successfully, but these errors were encountered: