xaizek / euclid-wm (License: BSD 3-Clause) (since 2018-12-07)
A minimalist, tiling window manager for X11 that seeks to allow easy management of numerous windows entirely from the keyboard.
Commit 6db47e98a03b62cf2d5216b62c0a1aeda7622be6

Fix crash on forgetting a window on a stack
Similarly to b2a72cf798357b55d11140a4d5153842381f549e which was caused
by `c->next` following `free(c)`, `s->next` is following `free(s)`
causing a crash.

A way to reproduce:
1. Start xterm
2. Run `gvim -f`
3. Put GVim's window on a stack
4. Press Ctrl-Z in xterm
5. Execute `exit` twice (first time just prints a warning about a
stopped job)
6. euclid-wm should crash here on trying to forget a window that's
currently hidden, specifically on dropping a corresponding
`struct stack_item`
Author: xaizek
Author date (UTC): 2023-12-25 17:53
Committer name: xaizek
Committer date (UTC): 2023-12-25 18:01
Parent(s): b4e6301cacaece0263501a564104e851412bb89e
Signing key: 99DC5E4DB05F6BE2
Tree: 9073178ef3632b89dbf731ba914d2fdf0ab14757
File Lines added Lines deleted
euclid-wm.c 5 1
File euclid-wm.c changed (mode: 100644) (index 7799b61..fe0e801)
... ... void forget_win (Window id) {
1026 1026 while (v != NULL) { while (v != NULL) {
1027 1027 s = v->stack; s = v->stack;
1028 1028 while (s != NULL) { while (s != NULL) {
1029 //storing this in case the entry will get free()'d
1030 struct stack_item *next_s = s->next;
1031
1029 1032 if (s->win == w) { if (s->win == w) {
1030 1033 if (s == v->stack) { if (s == v->stack) {
1031 1034 v->stack = s->next; v->stack = s->next;
 
... ... void forget_win (Window id) {
1048 1051 }; };
1049 1052 free(s); free(s);
1050 1053 }; };
1051 s = s->next;
1054
1055 s = next_s;
1052 1056 }; };
1053 1057 v = v->next; v = v->next;
1054 1058 }; };
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/euclid-wm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/euclid-wm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master