Prevent clipboard crash when mime type is missing.#154
Merged
JSUYA merged 3 commits intoflutter-tizen:masterfrom Feb 12, 2026
Merged
Prevent clipboard crash when mime type is missing.#154JSUYA merged 3 commits intoflutter-tizen:masterfrom
JSUYA merged 3 commits intoflutter-tizen:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates clipboard handling. In platform_channel.cc, raw pointer management for MethodResult is replaced with std::shared_ptr for asynchronous callbacks. In tizen_clipboard.cc, a call to on_data_callback_ is removed to prevent sending duplicate errors, the mime type check in SendData is updated to allow empty strings, and on_data_callback_ is nullified in the destructor. However, it introduces a new potential crash in the logging logic when a mime type is missing. Specifically, streaming a NULL pointer to the log stream is undefined behavior and can lead to a Denial of Service. This should be addressed by safely handling the NULL pointer during logging.
seungsoo47
approved these changes
Feb 12, 2026
I'm not sure exactly when an event is triggered with an empty type. However, even when copying plain text, the type can sometimes be empty. Therefore, if the type of the Ecore_Wl2_Event_Data_Source_Send event is empty, it is considered "text/plain."
871bfd2 to
b9661ab
Compare
JSUYA
added a commit
to JSUYA/flutter-tizen
that referenced
this pull request
Feb 13, 2026
Engine(fcd10a63f40a4e3656b21d2ee6003a090a6b47b7) - flutter-tizen/flutter#26 Embedder(dd2f6ba563596fa04d08c0b39c4a63a951c5a8f4) - flutter-tizen/embedder#142 - flutter-tizen/embedder#145 - flutter-tizen/embedder#144 - flutter-tizen/embedder#140 - flutter-tizen/embedder#151 - flutter-tizen/embedder#153 - flutter-tizen/embedder#152 - flutter-tizen/embedder#154 - flutter-tizen/embedder#156
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While testing the clipboard, I noticed that when I copied text, event's mime type was empty.
So, I confirmed that a crash occurred when I tried to paste without copying data to the event's fd.
To prevent this crash, I changed result_ptr to unique_ptr.
Also, to avoid sending an error result twice, GetData() does not call on_data_callback_.
(An error result is sent by returning false.)