Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backends/wayland/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn create_memfile() -> File {
let mut rng = fastrand::Rng::new();

for _ in 0..=4 {
let mut name = String::from("softbuffer-");
let mut name = String::from("/softbuffer-");
name.extend(iter::repeat_with(|| rng.alphanumeric()).take(7));
name.push('\0');

Expand Down
4 changes: 2 additions & 2 deletions src/backends/x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,13 @@ fn create_shm_id() -> io::Result<OwnedFd> {
use posix_shm::{Mode, OFlags};

let mut rng = fastrand::Rng::new();
let mut name = String::with_capacity(23);
let mut name = String::with_capacity(24);

// Only try four times; the chances of a collision on this space is astronomically low, so if
// we miss four times in a row we're probably under attack.
for i in 0..4 {
name.clear();
name.push_str("softbuffer-x11-");
name.push_str("/softbuffer-x11-");
name.extend(std::iter::repeat_with(|| rng.alphanumeric()).take(7));

// Try to create the shared memory segment.
Expand Down