Summary: | APIClient::initialize does not build with newer gcc | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Balazs Kelemen <kbalazs> | ||||
Component: | WebKit2 | Assignee: | Balazs Kelemen <kbalazs> | ||||
Status: | RESOLVED INVALID | ||||||
Severity: | Normal | CC: | mrowe | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Balazs Kelemen
2011-09-19 05:40:52 PDT
Created attachment 107839 [details]
Patch
Comment on attachment 107839 [details]
Patch
It looks like this restructuring will give bad behavior in a non-debug build if the client passed in is of a newer version than is expected. Previously that would result in m_client being initialized to zero. Now it’ll attempt to memcpy the size of the version passed in, which will be undefined… That seems bad?
(In reply to comment #2) > (From update of attachment 107839 [details]) > It looks like this restructuring will give bad behavior in a non-debug build if the client passed in is of a newer version than is expected. Previously that would result in m_client being initialized to zero. Now it’ll attempt to memcpy the size of the version passed in, which will be undefined… That seems bad? Yep, you are right, I didn't think that we should handle that case. It seems like there is no other possible solution for this than turning client->version from int to unsigned - but I guess it would be an API breakage so it's not an option. However it turned out that it is only a problem with gcc-4.5.1. 4.5.2 does not warn about that. Furthermore I couldn't reproduce the issue with a small example so maybe my way of though is false and this is just a compiler bug. |