mirror of
https://github.com/curl/curl.git
synced 2025-03-31 16:00:35 +08:00
unit1650: fix "null pointer passed as argument 1 to memcmp"
Detected by UndefinedBehaviorSanitizer Closes #3187
This commit is contained in:
parent
0c9b09dff4
commit
5728229a4f
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user