mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-28 07:58:00 -04:00
commit
59b5ba03c7
3 changed files with 18 additions and 4 deletions
|
|
@ -62,6 +62,8 @@
|
||||||
CSI codes in the Kitty keyboard protocol.
|
CSI codes in the Kitty keyboard protocol.
|
||||||
* Assertion in `shm.c:buffer_release()`
|
* Assertion in `shm.c:buffer_release()`
|
||||||
(https://codeberg.org/dnkl/foot/issues/844).
|
(https://codeberg.org/dnkl/foot/issues/844).
|
||||||
|
* Crash when setting a key- or mouse binding to the empty string
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/851).
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
6
config.c
6
config.c
|
|
@ -1726,6 +1726,12 @@ value_to_key_combos(struct context *ctx, int action, struct argv *argv,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (idx == 0) {
|
||||||
|
LOG_CONTEXTUAL_ERR(
|
||||||
|
"empty binding not allowed (set to 'none' to unmap)");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
remove_from_key_bindings_list(bindings, action, argv);
|
remove_from_key_bindings_list(bindings, action, argv);
|
||||||
|
|
||||||
bindings->arr = xrealloc(
|
bindings->arr = xrealloc(
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,16 @@ test_key_binding(struct context *ctx, bool (*parse_fun)(struct context *ctx),
|
||||||
const int click_count = action % 3 + 1;
|
const int click_count = action % 3 + 1;
|
||||||
|
|
||||||
/* Finally, generate the ‘value’ (e.g. “Control+shift+x”) */
|
/* Finally, generate the ‘value’ (e.g. “Control+shift+x”) */
|
||||||
char value[128];
|
char value[128] = {0};
|
||||||
|
|
||||||
|
ctx->key = key;
|
||||||
|
ctx->value = value;
|
||||||
|
|
||||||
|
/* First, try setting the empty string */
|
||||||
|
if (parse_fun(ctx)) {
|
||||||
|
BUG("[%s].%s=<empty>: did not fail to parse as expected",
|
||||||
|
ctx->section, ctx->key);
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case KEY_BINDING: {
|
case KEY_BINDING: {
|
||||||
|
|
@ -319,9 +328,6 @@ test_key_binding(struct context *ctx, bool (*parse_fun)(struct context *ctx),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->key = key;
|
|
||||||
ctx->value = value;
|
|
||||||
|
|
||||||
if (!parse_fun(ctx)) {
|
if (!parse_fun(ctx)) {
|
||||||
BUG("[%s].%s=%s failed to parse",
|
BUG("[%s].%s=%s failed to parse",
|
||||||
ctx->section, ctx->key, ctx->value);
|
ctx->section, ctx->key, ctx->value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue