emscripten-core / emscripten-core/emscripten
library_sockfs.js can access properties of undefined `dest` (logic flaw)
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
> [!NOTE]
> This issue was unearthed by us due to what seems an issue on our side. My colleague @Faless explains it on the [Godot Dev Chat](https://chat.godotengine.org/channel/web?msg=oMN3SjGjhpyzZqbw6). Though, the issue underlined is still a logic flaw.
Regression introduced by #22630
https://github.com/emscripten-core/emscripten/blob/06cebfca51f908d3bc6897113330e45a77010db2/src/library_sockfs.js#L632-L647
If `dest == null` and `sock.type !== {{{ cDefs.SOCK_DGRAM }}}` (see code above), then the following error occurs:
Contributor guide
Assessment
This issue has not been assessed yet.