aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-02-18 14:09:23 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-02-18 14:09:23 +0000
commit9f9ffa94348905509083904f5d542481875b1b25 (patch)
tree2538cff085c07847765a6dca70093f1a2f59d130
parentchangelog: --server=FD failing on FreeBSD (diff)
term: set_app_id(): app_id may be NULL, in which case we can't do strlen()
Closes #1963
-rw-r--r--CHANGELOG.md3
-rw-r--r--terminal.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3eedcb41..f4ed6459 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -116,6 +116,8 @@
ZERO WIDTH SPACE) being ignored (discarded and never stored in the
grid) ([#1960][1960]).
* `--server=<FD>` not working on FreeBSD ([#1956][1956]).
+* Crash when resetting the terminal and an application had previously
+ set a custom app ID ([#1963][1963])
[1918]: https://codeberg.org/dnkl/foot/issues/1918
[1929]: https://codeberg.org/dnkl/foot/issues/1929
@@ -123,6 +125,7 @@
[1954]: https://codeberg.org/dnkl/foot/issues/1954
[1960]: https://codeberg.org/dnkl/foot/issues/1960
[1956]: https://codeberg.org/dnkl/foot/issues/1956
+[1963]: https://codeberg.org/dnkl/foot/issues/1963
### Security
diff --git a/terminal.c b/terminal.c
index 2e868793..fd1c8937 100644
--- a/terminal.c
+++ b/terminal.c
@@ -3620,7 +3620,7 @@ term_set_app_id(struct terminal *term, const char *app_id)
term->app_id = NULL;
}
- const size_t length = strlen(app_id);
+ const size_t length = app_id != NULL ? strlen(app_id) : 0;
if (length > 2048) {
/*
* Not sure if there's a limit in the protocol, or the