We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2785824 commit 6a62544Copy full SHA for 6a62544
src/main.rs
@@ -202,6 +202,10 @@ where
202
)
203
.as_bytes(),
204
);
205
+ // We need the payload to be NUL-terminated. mmap(2) will guarantee that the returned region
206
+ // will be filled with zeroes, but if the trampoline + payload size happens to be page-aligned,
207
+ // we will segfault unless this extra explicit NUL is added!
208
+ shellcode.extend(b"\x00");
209
210
Ok(shellcode)
211
}
0 commit comments