This workarounds the following warnings with gcc analyzer:
kx.c:156:69: error: leak of FILE '<unknown>' [CWE-775] [-Werror=analyzer-file-leak]
156 | _gnutls_bin2hex(session->security_parameters.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
157 | client_random, GNUTLS_RANDOM_SIZE,
| ~~~~~~~~~~~~~
This should be harmless because the keylog file pointer is closed in
the ELF destructor.
Signed-off-by: Daiki Ueno <ueno@gnu.org>
return 0;
}
+/* GCC analyzer doesn't like static FILE pointer */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
+
void _gnutls_nss_keylog_write(gnutls_session_t session,
const char *label,
const uint8_t *secret, size_t secret_size)
}
}
+#pragma GCC diagnostic pop
+
/* here we generate the TLS Master secret.
*/
static int