mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 06:10:15 +00:00
Fix uninitialized digest_len field, causing WebSocket handshake to g_assert.
g_checksum_get_digest checks to ensure that the passed digest_len is long enough to hold the digest, before setting it to the actual length of the digest returned. Digest_len is uninitialized in the code, so if you're lucky it will be larger than 20 and everything will work fine. If you're unlucky, g_checksum_get_digest will return either -1 or some number less than 20, and the g_assert(digest_len==20) will fail.
This commit is contained in:
parent
e19cbd7a04
commit
981efc90b4
@ -660,8 +660,8 @@ send_error (HttpRequest *request,
|
||||
static gchar *
|
||||
generate_handshake_response_wsietf_v7 (const gchar *key)
|
||||
{
|
||||
guchar digest[20];
|
||||
gsize digest_len;
|
||||
gsize digest_len = 20;
|
||||
guchar digest[digest_len];
|
||||
GChecksum *checksum;
|
||||
|
||||
checksum = g_checksum_new (G_CHECKSUM_SHA1);
|
||||
|
Loading…
Reference in New Issue
Block a user