aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-12-01 17:30:29 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-12-01 17:30:29 +0000
commit1f6a663bed153dafae05f4af96cf80864ac83fc5 (patch)
tree5f1604337f92cfbc70332abc980edc914fa05dc7
parentinput: relax requirements for overriding keypad application mode (diff)
parentselection: do not try to paste un-handled mime types (diff)
Merge branch 'clipboard-ignore-unhandled-mime-types'
Closes #230
-rw-r--r--CHANGELOG.md2
-rw-r--r--selection.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 899da227..06783715 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -113,6 +113,8 @@ means foot can be PGO:d in e.g. sandboxed build scripts. See
* `footclient` `-m` (`--maximized`) flag being ignored.
* Crash with explicitly sized sixels with a height less than 6 pixels.
* Key mappings for `esc` with modifiers.
+* Crash when pasting non-textual clipboard content
+ (https://codeberg.org/dnkl/foot/issues/230).
### Security
diff --git a/selection.c b/selection.c
index 71f85b7e..cb57fd92 100644
--- a/selection.c
+++ b/selection.c
@@ -1370,7 +1370,9 @@ text_from_clipboard(struct seat *seat, struct terminal *term,
void (*done)(void *user), void *user)
{
struct wl_clipboard *clipboard = &seat->clipboard;
- if (clipboard->data_offer == NULL) {
+ if (clipboard->data_offer == NULL ||
+ clipboard->mime_type == DATA_OFFER_MIME_UNSET)
+ {
done(user);
return;
}
@@ -1512,7 +1514,9 @@ text_from_primary(
}
struct wl_primary *primary = &seat->primary;
- if (primary->data_offer == NULL){
+ if (primary->data_offer == NULL ||
+ primary->mime_type == DATA_OFFER_MIME_UNSET)
+ {
done(user);
return;
}