]> git.ipfire.org Git - thirdparty/gnutls.git/commit
pkcs11: read pkcs11.conf at once with gnutls_load_file
authorDaiki Ueno <ueno@gnu.org>
Thu, 3 Apr 2025 08:47:44 +0000 (17:47 +0900)
committerDaiki Ueno <ueno@gnu.org>
Thu, 24 Jul 2025 05:52:48 +0000 (14:52 +0900)
commit2fa4c4c14f9d19dbbcaebd4be430df10d6dd0978
treee337603f7f51e07f44faf89f05157a695069dc3a
parentc3a9670354045dd10238cda14fa27aa606cf9afc
pkcs11: read pkcs11.conf at once with gnutls_load_file

clang-analyzer from Clang 19 complains about the fgets usage while a
mutex is held:

  pkcs11.c:911:9: warning: Call to blocking function 'fgets' inside of critical section [unix.BlockInCriticalSection]
    911 |         while (fgets(line, sizeof(line), fp) != NULL) {
        |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This changes the logic to read the content of the file at once to
avoid iterative calls to fgets.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/pkcs11.c