Skip to content

Commit

Permalink
Push missing code
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBakerEffendi committed Jan 27, 2025
1 parent a1a8914 commit 95c12d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/code/sarif-test/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
int index_into_dst_array (char *dst, char *src, int offset) {
for(i = 0; i < strlen(src); i++) {
dst[i + + j*8 + offset] = src[i];
}
}

int vulnerable(size_t len, char *src) {
char *dst = malloc(len + 8);
memcpy(dst, src, len + 7);
}
4 changes: 3 additions & 1 deletion tests/finding-to-sarif-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ JOERN="$JOERN_TESTS_DIR"/..

mkdir -p /tmp/sarif
./joern-scan "$JOERN_TESTS_DIR/code/sarif-test" --store
echo "Code dir..."
ls $JOERN_TESTS_DIR/code
echo "Workspace..."
ls $JOERN/workspace
echp "Other workspace"
echo "Other workspace"
ls ../workspace
./joern --script "$JOERN_TESTS_DIR/test-sarif.sc" --param cpgFile="$JOERN/workspace/sarif-test/cpg.bin" --param outFile="/tmp/sarif/test.sarif"
exit_code=$(curl -s -X POST \
Expand Down

0 comments on commit 95c12d8

Please sign in to comment.