mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
prevent screenshot from resuing template array
The template array given to mkstemp was declared static. This reused the memory, which caused mkstemp to fail if backingfile is run more than once, because the array no longer contained the template syntax (which is forced to end in XXXXXX) but the previous file name.
This commit is contained in:
parent
69409ea3cb
commit
8ab0073b49
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ static const struct wl_registry_listener registry_listener = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int backingfile(off_t size) {
|
static int backingfile(off_t size) {
|
||||||
static char template[] = "/tmp/wlroots-shared-XXXXXX";
|
char template[] = "/tmp/wlroots-shared-XXXXXX";
|
||||||
int fd, ret;
|
int fd, ret;
|
||||||
|
|
||||||
fd = mkstemp(template);
|
fd = mkstemp(template);
|
||||||
|
|
Loading…
Reference in a new issue