[SOUP] Certificate decoder always returns GByteArray with zero size
authoraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Nov 2018 16:37:29 +0000 (16:37 +0000)
committeraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Nov 2018 16:37:29 +0000 (16:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191888

Reviewed by Žan Doberšek.

No new tests needed.

* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing
call to g_byte_array_set_size() to make sure byteArray->len has the
correct value.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/soup/CertificateInfo.h

index e420a33..8e723df 100644 (file)
@@ -1,3 +1,17 @@
+2018-11-21  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [SOUP] Certificate decoder always returns GByteArray with zero size
+        https://bugs.webkit.org/show_bug.cgi?id=191888
+
+        Reviewed by Žan Doberšek.
+
+        No new tests needed.
+
+        * platform/network/soup/CertificateInfo.h:
+        (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing
+        call to g_byte_array_set_size() to make sure byteArray->len has the
+        correct value.
+
 2018-11-21  Zalan Butjas  <zalan@apple.com>
 
         [LFC][IFC] Take nonBreakableStart/End into use.
index ba31fc1..a0a76da 100644 (file)
@@ -83,7 +83,8 @@ template<> struct Coder<GRefPtr<GByteArray>> {
             return false;
 
         byteArray = adoptGRef(g_byte_array_sized_new(size));
-        return decoder.decodeFixedLengthData(byteArray->data, byteArray->len);
+        g_byte_array_set_size(byteArray.get(), size);
+        return decoder.decodeFixedLengthData(byteArray->data, size);
     }
 };