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 83797
[EFL] [DRT] Feeding key events with invalid keyName
https://bugs.webkit.org/show_bug.cgi?id=83797
Summary
[EFL] [DRT] Feeding key events with invalid keyName
Sudarsana Nagineni (babu)
Reported
2012-04-12 11:13:31 PDT
keyName passed to KeyEventInfo is not valid after this function returns, so use CString to keep the keyName valid within the scope of KeyEventInfo. static KeyEventInfo* createKeyEventInfo(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { .... const CString cCharacter = character.get()->ustring().utf8(); .... if (!keyName) keyName = cCharacter.data(); return new KeyEventInfo(keyName, modifiers); }
Attachments
Patch
(3.38 KB, patch)
2012-04-12 11:40 PDT
,
Sudarsana Nagineni (babu)
pnormand
: review-
pnormand
: commit-queue-
Details
Formatted Diff
Diff
Patch
(4.54 KB, patch)
2012-04-16 06:46 PDT
,
Sudarsana Nagineni (babu)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sudarsana Nagineni (babu)
Comment 1
2012-04-12 11:40:06 PDT
Created
attachment 136942
[details]
Patch Using CString to keep the keyName valid within scope of KeyEventInfo
Raphael Kubo da Costa (:rakuco)
Comment 2
2012-04-13 10:27:26 PDT
Comment on
attachment 136942
[details]
Patch Makes sense, thanks.
Philippe Normand
Comment 3
2012-04-16 04:42:17 PDT
Comment on
attachment 136942
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=136942&action=review
> Tools/DumpRenderTree/efl/EventSender.cpp:437 > const CString cCharacter = character.get()->ustring().utf8(); > const char* keyName = (location == DomKeyLocationNumpad) ? keyPadNameFromJSValue(character.get()) : keyNameFromJSValue(character.get()); > - if (!keyName) > - keyName = cCharacter.data(); > > - return new KeyEventInfo(keyName, modifiers); > + return new KeyEventInfo(keyName ? CString(keyName) : cCharacter, modifiers);
Seems like keyPadNameFromJSValue() should return a CString now. That would simplify this code block, I think.
Sudarsana Nagineni (babu)
Comment 4
2012-04-16 06:36:54 PDT
(In reply to
comment #3
)
> (From update of
attachment 136942
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=136942&action=review
> > > Tools/DumpRenderTree/efl/EventSender.cpp:437 > > const CString cCharacter = character.get()->ustring().utf8(); > > const char* keyName = (location == DomKeyLocationNumpad) ? keyPadNameFromJSValue(character.get()) : keyNameFromJSValue(character.get()); > > - if (!keyName) > > - keyName = cCharacter.data(); > > > > - return new KeyEventInfo(keyName, modifiers); > > + return new KeyEventInfo(keyName ? CString(keyName) : cCharacter, modifiers); > > Seems like keyPadNameFromJSValue() should return a CString now. That would simplify this code block, I think.
Thanks for your review Philippe. Yes, it simplifies the code. I will update the patch.
Sudarsana Nagineni (babu)
Comment 5
2012-04-16 06:46:10 PDT
Created
attachment 137335
[details]
Patch fixed review
comment #3
.
WebKit Review Bot
Comment 6
2012-04-16 07:17:48 PDT
Comment on
attachment 137335
[details]
Patch Clearing flags on attachment: 137335 Committed
r114250
: <
http://trac.webkit.org/changeset/114250
>
WebKit Review Bot
Comment 7
2012-04-16 07:17: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