aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-10-29 10:27:04 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-10-29 16:14:40 +0100
commit5728229a4fd209421fdd324dab5fd445d5917508 (patch)
tree1c0b3e315197df19edfbd12aadf8739a678254de /tests/unit
parent0c9b09dff4913134e3e99bbdbef00a71c5e5d7e3 (diff)
unit1650: fix "null pointer passed as argument 1 to memcmp"
Detected by UndefinedBehaviorSanitizer Closes #3187
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/unit1650.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/unit1650.c b/tests/unit/unit1650.c
index 723c06421..ddf228f8d 100644
--- a/tests/unit/unit1650.c
+++ b/tests/unit/unit1650.c
@@ -170,7 +170,7 @@ UNITTEST_START
fprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size));
return 2;
}
- else if(memcmp(req[i].packet, buffer, size)) {
+ else if(req[i].packet && memcmp(req[i].packet, buffer, size)) {
fprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size));
fprintf(stderr, "... instead of: %s\n",
hexdump((unsigned char *)req[i].packet, size));