emscripten-core / emscripten-core/emscripten

library_sockfs.js can access properties of undefined `dest` (logic flaw)

Open
#23,046 1 comment 0 reactions 1 assignee Claimed by @juj View on GitHub
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:

Capture d’écran, le 2024-12-02 à 11 27 03

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.