[Webkit-unassigned] [Bug 144096] [UNIX] Do not allow copies of IPC::Attachment

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 23 08:05:33 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=144096

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #251427|review?                     |review+
              Flags|                            |

--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 251427
  --> https://bugs.webkit.org/attachment.cgi?id=251427
Patch

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

This is OK, but could be improved.

> Source/WebKit2/Platform/IPC/ArgumentDecoder.cpp:217
> +    attachment = WTF::move(m_attachments.last());
>      m_attachments.removeLast();

Should instead be:

    attachment = m_attachments.takeLast();

> Source/WebKit2/Platform/IPC/Attachment.cpp:59
> +    encoder.addAttachment(Attachment(*this));
> +#if USE(UNIX_DOMAIN_SOCKETS)
> +    // The encoder takes the onwership of our file descriptor.
> +    m_fileDescriptor = -1;
> +#endif

Should instead be:

    encoding.addAttachment(WTF::move(*this));

> Source/WebKit2/Platform/IPC/Attachment.h:85
> +    Attachment(const Attachment&) = default;
> +    Attachment& operator=(Attachment&) = default;

Why default? Why not delete? I think this is only needed because of the incorrect code in Attachment::encode.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150423/6684d2e6/attachment-0001.html>


More information about the webkit-unassigned mailing list