aboutsummaryrefslogtreecommitdiff
path: root/qemu_mode
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-04-16 15:02:36 +0200
committervanhauser-thc <vh@thc.org>2021-04-16 15:02:36 +0200
commitc30999562e0a0e03d1412b16fb33b5874ed96914 (patch)
treefcd021eed2e2947ef1bd8c5ea1d8afd442af57ce /qemu_mode
parent3c68208dd3f19567239cba8f5ae781f79f64e99c (diff)
downloadAFLplusplus-c30999562e0a0e03d1412b16fb33b5874ed96914.tar.gz
fix compcovtest
Diffstat (limited to 'qemu_mode')
-rw-r--r--qemu_mode/libcompcov/compcovtest.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/qemu_mode/libcompcov/compcovtest.cc b/qemu_mode/libcompcov/compcovtest.cc
index 92e3864c..3c975e15 100644
--- a/qemu_mode/libcompcov/compcovtest.cc
+++ b/qemu_mode/libcompcov/compcovtest.cc
@@ -50,17 +50,28 @@ int main(int argc, char **argv) {
strncmp(&buffer[20], "jumps over ", 11) != 0 ||
strcmp(&buffer[31], "the lazy dog") != 0) {
+ if (argc > 1) { fclose(file); }
return 1;
}
uint64_t x = 0;
fread(&x, sizeof(x), 1, file);
- if (x != 0xCAFEBABECAFEBABE) { return 2; }
+ if (x != 0xCAFEBABECAFEBABE) {
+
+ if (argc > 1) { fclose(file); }
+ return 2;
+
+ }
uint32_t y = 0;
fread(&y, sizeof(y), 1, file);
- if (y != 0xDEADC0DE) { return 3; }
+ if (y != 0xDEADC0DE) {
+
+ if (argc > 1) { fclose(file); }
+ return 3;
+
+ }
uint16_t z = 0;
fread(&z, sizeof(z), 1, file);
@@ -71,6 +82,7 @@ int main(int argc, char **argv) {
break;
default:
+ if (argc > 1) { fclose(file); }
return 4;
}