WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 38765
[Chromium] WebFrame::registerPasswordListener shouldn't assert on duplicate listener
https://bugs.webkit.org/show_bug.cgi?id=38765
Summary
[Chromium] WebFrame::registerPasswordListener shouldn't assert on duplicate l...
Jens Alfke
Reported
2010-05-07 12:13:20 PDT
The Chromium WebKit API's implementation of WebFrame::registerPasswordListener currently requires that the given input element not already have a listener, and crashes with an ASSERT failure if it does. Unfortunately the method can be called multiple times on the same elements if the page contains duplicate forms with the same action URL. This causes such pages to crash debug builds of Chromium*. The fix is either (a) make the caller defensive and check the current list of listeners before trying to add a new one, or (b) make registerPasswordListener treat duplicate listeners as a recoverable error by returning false. Option (a) requires more code and incurs runtime overhead, so I think (b) is best. Note that since registerPasswordListener's contract is to take ownership of the listener pointer, it must delete it immediately if it can't register it. *
http://code.google.com/p/chromium/issues/detail?id=20418
Attachments
patch
(3.21 KB, patch)
2010-05-07 12:19 PDT
,
Jens Alfke
no flags
Details
Formatted Diff
Diff
patch 2
(3.21 KB, patch)
2010-05-07 13:17 PDT
,
Jens Alfke
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jens Alfke
Comment 1
2010-05-07 12:19:47 PDT
Created
attachment 55405
[details]
patch
WebKit Review Bot
Comment 2
2010-05-07 12:23:13 PDT
Attachment 55405
[details]
did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 WebKit/chromium/src/WebFrameImpl.cpp:1950: Missing space before { [whitespace/braces] [5] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Fisher (:fishd, Google)
Comment 3
2010-05-07 12:57:05 PDT
Why not just have registerPasswordListener clobber the existing listener? Or, provide a hasPasswordListener method? It might also be nice to support unregistering a listener (perhaps by passing 0 to registerPasswordListener).
Jens Alfke
Comment 4
2010-05-07 13:17:48 PDT
Created
attachment 55413
[details]
patch 2 Added a space to appease the coding style gods.
Darin Fisher (:fishd, Google)
Comment 5
2010-05-07 13:48:21 PDT
Comment on
attachment 55413
[details]
patch 2 OK, I'm convinced. It might be nice to provide a way to unregister a listener, but that doesn't have to be part of this patch, and perhaps we can wait on that until we have a need for it. R=me
WebKit Commit Bot
Comment 6
2010-05-08 11:06:47 PDT
Comment on
attachment 55413
[details]
patch 2 Clearing flags on attachment: 55413 Committed
r59029
: <
http://trac.webkit.org/changeset/59029
>
WebKit Commit Bot
Comment 7
2010-05-08 11:06:53 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug