]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
travis: turn on nonnull-attribute on Fuzzit
authorEvgeny Vereshchagin <evvers@ya.ru>
Sat, 15 Jun 2019 21:12:24 +0000 (23:12 +0200)
committerEvgeny Vereshchagin <evvers@ya.ru>
Sat, 15 Jun 2019 21:12:24 +0000 (23:12 +0200)
src/resolve/resolved-dns-rr.c
test/fuzz/fuzz-dns-packet/crash-497be373856c321a8a7b06589df9b2ff2e0d866a [new file with mode: 0644]
travis-ci/managers/fuzzit.sh

index 4cbb9723e21f69a1247215327cc114a766b6eb69..6ba26a24b2c3f2cc02d6f66851831e0a7844f831 100644 (file)
@@ -7,6 +7,7 @@
 #include "dns-type.h"
 #include "escape.h"
 #include "hexdecoct.h"
 #include "dns-type.h"
 #include "escape.h"
 #include "hexdecoct.h"
+#include "memory-util.h"
 #include "resolved-dns-dnssec.h"
 #include "resolved-dns-packet.h"
 #include "resolved-dns-rr.h"
 #include "resolved-dns-dnssec.h"
 #include "resolved-dns-packet.h"
 #include "resolved-dns-rr.h"
@@ -555,7 +556,7 @@ int dns_resource_record_new_address(DnsResourceRecord **ret, int family, const u
 
 #define FIELD_EQUAL(a, b, field) \
         ((a).field ## _size == (b).field ## _size &&  \
 
 #define FIELD_EQUAL(a, b, field) \
         ((a).field ## _size == (b).field ## _size &&  \
-         memcmp((a).field, (b).field, (a).field ## _size) == 0)
+         memcmp_safe((a).field, (b).field, (a).field ## _size) == 0)
 
 int dns_resource_record_payload_equal(const DnsResourceRecord *a, const DnsResourceRecord *b) {
         int r;
 
 int dns_resource_record_payload_equal(const DnsResourceRecord *a, const DnsResourceRecord *b) {
         int r;
diff --git a/test/fuzz/fuzz-dns-packet/crash-497be373856c321a8a7b06589df9b2ff2e0d866a b/test/fuzz/fuzz-dns-packet/crash-497be373856c321a8a7b06589df9b2ff2e0d866a
new file mode 100644 (file)
index 0000000..8d24e57
Binary files /dev/null and b/test/fuzz/fuzz-dns-packet/crash-497be373856c321a8a7b06589df9b2ff2e0d866a differ
index 71858b4be87c3ddbec2ba06fed489a344368af03..6261bd672040cb6dbd805665fc6c3c3efe7d2385 100755 (executable)
@@ -21,7 +21,7 @@ export PATH="$HOME/.local/bin/:$PATH"
 # https://github.com/systemd/systemd/pull/12771#issuecomment-502139157 are sorted out at least.
 # TODO: "null" should probably be added too. On OSS-Fuzz it was turned off in https://github.com/google/oss-fuzz/pull/674
 # TODO: figure out what to do about unsigned-integer-overflow: https://github.com/google/oss-fuzz/issues/910
 # https://github.com/systemd/systemd/pull/12771#issuecomment-502139157 are sorted out at least.
 # TODO: "null" should probably be added too. On OSS-Fuzz it was turned off in https://github.com/google/oss-fuzz/pull/674
 # TODO: figure out what to do about unsigned-integer-overflow: https://github.com/google/oss-fuzz/issues/910
-export SANITIZER="address -fsanitize=bool,array-bounds,float-divide-by-zero,function,integer-divide-by-zero,return,shift,signed-integer-overflow,unsigned-integer-overflow,vla-bound,vptr -fno-sanitize-recover=bool,array-bounds,float-divide-by-zero,function,integer-divide-by-zero,return,shift,signed-integer-overflow,vla-bound,vptr"
+export SANITIZER="address -fsanitize=bool,array-bounds,float-divide-by-zero,function,integer-divide-by-zero,return,shift,signed-integer-overflow,unsigned-integer-overflow,vla-bound,vptr,nonnull-attribute -fno-sanitize-recover=bool,array-bounds,float-divide-by-zero,function,integer-divide-by-zero,return,shift,signed-integer-overflow,vla-bound,vptr,nonnull-attribute"
 tools/oss-fuzz.sh
 
 FUZZING_TYPE=${1:-sanity}
 tools/oss-fuzz.sh
 
 FUZZING_TYPE=${1:-sanity}