Commit 4506d185 authored by Simon McVittie's avatar Simon McVittie
Browse files

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's avatarSimon McVittie <smcv@collabora.com>
(cherry picked from commit 61bb52ec)
parent d9db1faa
......@@ -291,7 +291,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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment