Skip to content

Update dlfcn-win32 to v1.4.2#136

Merged
garbear merged 1 commit intoxbmc:Piersfrom
garbear:update-dlfcn
Mar 11, 2026
Merged

Update dlfcn-win32 to v1.4.2#136
garbear merged 1 commit intoxbmc:Piersfrom
garbear:update-dlfcn

Conversation

@garbear
Copy link
Member

@garbear garbear commented Mar 10, 2026

Description

Cross-port of kodi-game/game.libretro#148

Split out from #133

How has this been tested?

Tested along with #133 on all platforms. Windows has a black screen, but that's probably due to the 4.x port.

@kodiai
Copy link

kodiai bot commented Mar 10, 2026

Kodiai Review Summary

What Changed

Updates dlfcn-win32 dependency from v1.2.0 to v1.4.2, including rebased patches for Windows and UWP builds and CI changes to handle patch binary mode.

Reviewed: core logic, config, docs

Strengths

  • ✅ Added .gitattributes to prevent line ending corruption of patch files (.gitattributes:2-3)
  • ✅ Patch wrapper implementation ensures --binary flag for patch operations on Windows UWP builds (azure-pipelines.yml:57-96)

Observations

Impact

[CRITICAL] depends/windows/dlfcn-win32/0001-dlopen_with_widechar.patch (22): Memory leak when malloc fails
The code allocates memory with malloc() at line 22 but never checks if the allocation succeeded. If malloc() returns NULL (out of memory), the subsequent MultiByteToWideChar() call will write to a null pointer, causing a crash.

[MAJOR] depends/windowsstore/dlfcn-win32/0001-win10-fixed-uwp-build.patch (78): Memory leak when malloc fails
Same issue as above - malloc() result is not checked before use at line 78. On allocation failure, this will cause a null pointer dereference.

[MAJOR] depends/windowsstore/dlfcn-win32/0001-win10-fixed-uwp-build.patch (74-76): Early return causes memory cleanup issues
The code returns NULL at line 76 when MultiByteToWideChar fails, but this happens inside the dlopen() function after other resources may have been allocated. This bypasses the normal cleanup path and error handling that occurs at the function's end.

Verdict

🔴 Address before merging -- 3 blocking issue(s) found

Review Details
  • Files reviewed: 8
  • Lines changed: +155 -97
  • Profile: balanced (auto, lines changed: 252)
  • Author: newcomer (adapted tone)
  • Findings: 1 critical, 2 major, 0 medium, 0 minor (includes 3 from summary observations)
  • Review completed: 2026-03-10T21:08:10.483Z
  • Keyword parsing: No keywords detected

@garbear garbear merged commit 7188d15 into xbmc:Piers Mar 11, 2026
7 of 8 checks passed
@garbear garbear deleted the update-dlfcn branch March 11, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant