Hi Mark, Mark H Weaver skribis: > This reminds me of a bug that I found in the Guile binding in GnuTLS a > while ago, but forgot to report. Maybe it's related: > > In 'set_certificate_file' in gnutls-3.5.9/guile/src/core.c: > > static unsigned int > set_certificate_file (certificate_set_file_function_t set_file, > SCM cred, SCM file, SCM format, const char *func_name) > #define FUNC_NAME func_name > { > int err; > char *c_file; > size_t c_file_len; > > gnutls_certificate_credentials_t c_cred; > gnutls_x509_crt_fmt_t c_format; > > c_cred = scm_to_gnutls_certificate_credentials (cred, 1, FUNC_NAME); > SCM_VALIDATE_STRING (2, file); > c_format = scm_to_gnutls_x509_certificate_format (format, 3, FUNC_NAME); > > c_file_len = scm_c_string_length (file); > c_file = alloca (c_file_len + 1); > > (void) scm_to_locale_stringbuf (file, c_file, c_file_len + 1); > c_file[c_file_len] = '\0'; > > err = set_file (c_cred, c_file, c_format); > if (EXPECT_FALSE (err < 0)) > scm_gnutls_error (err, FUNC_NAME); > > /* Return the number of certificates processed. */ > return ((unsigned int) err); > } > > 'scm_c_string_length' is inappropriately assumed to return the length > of the encoded C string in bytes, whereas it actually returns the > number of characters (code points). This is terrible! WDYT of this: