Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
c8c286ab
Commit
c8c286ab
authored
Sep 18, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added fuzzer for XER test 70
parent
4fe28822
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
8 deletions
+43
-8
tests/tests-c-compiler/check-assembly.sh
tests/tests-c-compiler/check-assembly.sh
+15
-8
tests/tests-c-compiler/check-src/check-70.-fwide-types.c
tests/tests-c-compiler/check-src/check-70.-fwide-types.c
+14
-0
tests/tests-c-compiler/check-src/check-70.c
tests/tests-c-compiler/check-src/check-70.c
+14
-0
No files found.
tests/tests-c-compiler/check-assembly.sh
View file @
c8c286ab
...
...
@@ -51,10 +51,24 @@ fi
OFS
=
$IFS
IFS
=
"."
set
$args
data_dir
=
$(
echo
"
$1
"
|
sed
-e
s/check-/data-/
)
shift
IFS
=
$OFS
AFLAGS
=
"
$*
"
if
[
-d
${
data_dir
}
]
;
then
OPT_DATA_DIR
=
"../
${
data_dir
}
"
else
OPT_DATA_DIR
=
""
fi
if
test
"
${
LIBFUZZER_CFLAGS
}
"
&&
grep
LLVMFuzzer
${
source_full
}
>
/dev/null
;
then
MAKE_FUZZER
=
yes
else
MAKE_FUZZER
=
no
fi
# Assume the test fails. Will be removed when it passes well.
testdir
=
test-
${
args
}
if
[
-f
"
${
testdir
}
-FAILED"
]
;
then
...
...
@@ -65,13 +79,6 @@ touch "${testdir}-FAILED"
mkdir
-p
"
${
testdir
}
"
ln
-fns
"../
${
source_full
}
"
"
${
testdir
}
"
if
test
"
${
LIBFUZZER_CFLAGS
}
"
&&
grep
LLVMFuzzer
${
source_full
}
>
/dev/null
;
then
MAKE_FUZZER
=
yes
else
MAKE_FUZZER
=
no
fi
asn_module
=
$(
echo
"
${
abs_top_srcdir
}
/tests/tests-asn1c-compiler/
${
testno
}
"
-
*
.asn1
)
AUTOGENERATED
=
"# This file is autogenerated by
$0
${
source_full
}
${
AFLAGS
}
"
...
...
@@ -116,7 +123,7 @@ cat <<TARGETS >> "${testdir}/Makefile.targets"
check-fuzzer:
TARGETS
else
CHECK_FUZZER
=
"UBSAN_OPTIONS=print_stacktrace=1 ./check-fuzzer -timeout=3 -max_total_time=60 -max_len=512 -detect_leaks=1"
CHECK_FUZZER
=
"UBSAN_OPTIONS=print_stacktrace=1 ./check-fuzzer -timeout=3 -max_total_time=60 -max_len=512 -detect_leaks=1
${
OPT_DATA_DIR
}
"
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets"
check-fuzzer:
\$
(OBJS)
rm -f
${
source_obj
}
...
...
tests/tests-c-compiler/check-src/check-70.-fwide-types.c
View file @
c8c286ab
...
...
@@ -277,6 +277,19 @@ process(const char *fname) {
return
1
;
}
#ifdef ENABLE_LIBFUZZER
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
Data
,
size_t
Size
)
{
PDU_t
*
st
=
0
;
asn_dec_rval_t
rval
;
rval
=
asn_decode
(
0
,
ATS_BASIC_XER
,
&
asn_DEF_PDU
,
(
void
**
)
&
st
,
Data
,
Size
);
assert
(
rval
.
consumed
<=
Size
);
ASN_STRUCT_FREE
(
asn_DEF_PDU
,
st
);
return
0
;
}
#else
int
main
()
{
DIR
*
dir
;
...
...
@@ -309,3 +322,4 @@ main() {
return
0
;
}
#endif
tests/tests-c-compiler/check-src/check-70.c
View file @
c8c286ab
...
...
@@ -256,6 +256,19 @@ process(const char *fname) {
return
1
;
}
#ifdef ENABLE_LIBFUZZER
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
Data
,
size_t
Size
)
{
PDU_t
*
st
=
0
;
asn_dec_rval_t
rval
;
rval
=
asn_decode
(
0
,
ATS_BASIC_XER
,
&
asn_DEF_PDU
,
(
void
**
)
&
st
,
Data
,
Size
);
assert
(
rval
.
consumed
<=
Size
);
ASN_STRUCT_FREE
(
asn_DEF_PDU
,
st
);
return
0
;
}
#else
int
main
()
{
DIR
*
dir
;
...
...
@@ -286,3 +299,4 @@ main() {
return
0
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment