summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2021-02-08 10:04:48 +0000
committerSimon McVittie <smcv@collabora.com>2021-02-08 10:05:15 +0000
commit61bb52ec42de1082bfb06ce1c737fc295bfe60b8 (patch)
treedd4c601e4480fdce3da152cac78e6a53d928851a
parentfa248f7f71cf4e1658374acb8351efd4cc8d108c (diff)
downloadglib-61bb52ec42de1082bfb06ce1c737fc295bfe60b8.tar.gz
gtlspassword: Fix inverted assertion
The intention here was to assert that the length of the password fits in a gssize. Passwords more than half the size of virtual memory are probably excessive. Fixes: a8b204ff "gtlspassword: Forbid very long TLS passwords" Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--gio/gtlspassword.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
index f5e02a1a8..948e812df 100644
--- a/gio/gtlspassword.c
+++ b/gio/gtlspassword.c
@@ -290,7 +290,7 @@ g_tls_password_set_value (GTlsPassword *password,
{
/* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
gsize length_unsigned = strlen ((gchar *) value);
- g_return_if_fail (length_unsigned > G_MAXSSIZE);
+ g_return_if_fail (length_unsigned <= G_MAXSSIZE);
length = (gssize) length_unsigned;
}