[glib/glib-2-68: 3/4] tests/tls-certificate: Add context to the new test
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-68: 3/4] tests/tls-certificate: Add context to the new test
- Date: Mon, 7 Jun 2021 13:22:59 +0000 (UTC)
commit afd31d93b534cf89d5d0e1fc0496b1f4d5a0fa5f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Sat Jun 5 10:14:24 2021 -0400
tests/tls-certificate: Add context to the new test
Add a comment to `pem_parser_no_sentinel()` to explain what it is
testing and how it works.
gio/tests/tls-certificate.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gio/tests/tls-certificate.c b/gio/tests/tls-certificate.c
index ac046d15d..9dd415091 100644
--- a/gio/tests/tls-certificate.c
+++ b/gio/tests/tls-certificate.c
@@ -220,6 +220,10 @@ pem_parser_no_sentinel (void)
memmove (pem_copy, pem, pem_len);
g_free (pem);
+ /* Check whether the parser respects the @length parameter.
+ * pem_copy is allocated exactly pem_len bytes, so accessing memory
+ * outside its bounds will be detected by, for example, valgrind or
+ * asan. */
cert = g_tls_certificate_new_from_pem (pem_copy, pem_len, &error);
g_assert_no_error (error);
g_assert_nonnull (cert);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]