libgcrypt 1.12.0 and 1.11.3 Windows LoadLibraryEx, CloseHandle/FreeLibrary mismatch
John Thacker
johnthacker at gmail.com
Sun May 10 16:21:43 CEST 2026
Hello,
In Wireshark we have noticed some issues with the recent libgcrypt releases
1.11.3 and 1.12.2, discussed here:
https://gitlab.com/wireshark/wireshark/-/work_items/21251
A recent commit opens Windows DLL "shell32.dll" with LoadLibraryEx, but
closes it with CloseHandle instead of FreeLibrary. FreeLibrary does
reference counting, but CloseHandle does not, which causes problems if an
application already has opened shell32.dll for other reasons:
https://github.com/gpg/libgcrypt/commit/d5e3cbfd8845a872d39f468da27a443cea4587e2
https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa
Separately, we have a more minor concern that it's more appropriate to
typedef Windows SSIZE_T to ssize_t rather than long, because long is 32-bit
on Windows even on 64-bit platforms whereas SSIZE_T is not.
Due to the GnuPG/libgcrypt bug system not accepting registration right now
due to scraping, none of the Wireshark core developers have memberships in
order to create bugs or post the patches. Please look at our discussion
linked above.
Thanks,
John Thacker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gcrypt-devel/attachments/20260510/f611c082/attachment-0001.html>
More information about the Gcrypt-devel
mailing list