mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-03 07:53:39 +02:00
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user