Bug 190867

Summary: [WPE][GTK] Cleanups to the certificate decoder
Product: WebKit Reporter: Claudio Saavedra <csaavedra>
Component: WPE WebKitAssignee: Claudio Saavedra <csaavedra>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, mcatanzaro, zan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Claudio Saavedra 2018-10-24 04:16:40 PDT
[WPE][GTK] Cleanups to the certificate decoder
Comment 1 Claudio Saavedra 2018-10-24 04:17:01 PDT
Created attachment 353031 [details]
Patch
Comment 2 Claudio Saavedra 2018-10-24 06:45:36 PDT
Comment on attachment 353031 [details]
Patch

Clearing flags on attachment: 353031

Committed r237380: <https://trac.webkit.org/changeset/237380>
Comment 3 Claudio Saavedra 2018-10-24 06:45:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Michael Catanzaro 2018-10-24 07:56:54 PDT
Comment on attachment 353031 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353031&action=review

> Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp:103
> +        GRefPtr<GByteArray> certificateData = g_byte_array_sized_new(certificateDataReference.size());

Now, because you did not use adotpGRef(), there are two refs to the GByteArray: the original one, and the GRefPtr's.

> Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp:104
> +        certificateData = g_byte_array_append(certificateData.get(), certificateDataReference.data(), certificateDataReference.size());

So now the GRefPtr would drop its ref on the original GByteArray and ref the new one. But the original ref on the original GByteArray has been lost. Right? I think you need to use adoptGRef() on the line above.