[Webkit-unassigned] [Bug 238797] [GTK][WPE] RemoteInspector add support for IPv6

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 6 05:46:28 PDT 2022


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

--- Comment #8 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 456686
  --> https://bugs.webkit.org/attachment.cgi?id=456686
Patch

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

>> Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorServer.cpp:194
>> +        g_warning("Failed to start remote inspector server on %s: %s\n", address.get(), error->message);
> 
> No trailing \n! (Does other preexisting code have this problem?)

I think I fixed the others in previous patches

>> Source/WebKit/UIProcess/API/glib/WebKitInitialize.cpp:71
>> +        }
> 
> Careful: if for some reason the colon is the first or second character in the string, then you'll have memory corruption here. Got to make sure it's safe before dereferencing *(portPtr - 2)

This case is actually covered already. 

char* portPtr = g_strrstr(inspectorAddress.get(), ":");
if portPtr is nullptr we return early, so we know there's ':'

*portPtr = '\0';
portPtr++;
we change ':' by '\0' and move to the next character

auto port = g_ascii_strtoull(portPtr, nullptr, 10);
if portPtr at this point points to '\0' strtoull fails, so we return early

so after this portPtr - 2 is always the position before the ':' that is now '\0'

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220406/e7e378b1/attachment.htm>


More information about the webkit-unassigned mailing list