Add code and tests

This commit is contained in:
Valentin Brandl 2019-12-16 18:03:58 +01:00
parent 020a4542fb
commit ce57d811ff
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D
8 changed files with 38 additions and 0 deletions

5
code/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
gcc-9.2.0.tar.xz
gcc-9.2.0.tar.xz.sig
llvm-project.181ab91efc9.tar.xz
clang.181ab91efc9
gcc-9.2

8
code/build_clang.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
mkdir build \
&& cd build \
&& cmake -DLLVM_ENABLE_PROJECTS=clang \
-DCMAKE_BUILD_TYPE=Release \
-G "Unix Makefiles" ../llvm \
&& make -j8

10
code/build_gcc.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
mkdir objdir \
&& cd objdir \
&& ../configure \
--build=x86_64-linux-gnu \
--host=x86_64-linux-gnu \
--target=x86_64-linux-gnu \
--disable-multilib \
&& make -j8

View File

@ -0,0 +1 @@
{ "vuln.clang": { "relro":"partial","canary":"no","nx":"yes","pie":"no","rpath":"no","runpath":"no","symbols":"yes","fortify_source":"no","fortified":"0","fortify-able":"0" } }

View File

@ -0,0 +1 @@
{ "vuln.gcc": { "relro":"partial","canary":"no","nx":"yes","pie":"no","rpath":"no","runpath":"no","symbols":"yes","fortify_source":"no","fortified":"0","fortify-able":"0" } }

13
code/vuln.c Normal file
View File

@ -0,0 +1,13 @@
#include<string.h>
void vuln(char *input) {
char buf[50];
size_t len = strlen(input);
for (size_t i = 0; i < len; i++) {
buf[i] = input[i];
}
}
int main(int argc, char **argv) {
vuln(argv[1]);
return 0;
}

BIN
code/vuln.clang Executable file

Binary file not shown.

BIN
code/vuln.gcc Executable file

Binary file not shown.