mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +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> (cherry picked from commit61bb52ec42
)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user