From 39076c36b8c91c0d905013f9f285465bb2024623 Mon Sep 17 00:00:00 2001
From: Toby Murray <toby.murray@unimelb.edu.au>
Date: Tue, 10 Sep 2019 14:36:35 +1000
Subject: [PATCH] save to /dev/null when fuzzing etc.
---
src/passbook-vuln-1.c | 2 +-
src/passbook-vuln-2.c | 2 +-
src/passbook-vuln-3.c | 2 +-
src/passbook-vuln-4.c | 2 +-
src/passbook-vuln-5.c | 2 +-
src/passbook.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/passbook-vuln-1.c b/src/passbook-vuln-1.c
index 9a6227d..2a2ae56 100644
--- a/src/passbook-vuln-1.c
+++ b/src/passbook-vuln-1.c
@@ -364,7 +364,7 @@ int save_levelorder(const node_t *p, const char *masterpw,
const char * filename){
#ifdef PASSBOOK_FUZZ
// ignore the file name when fuzzing etc. to avoid DoS on the server
- FILE *f = fopen(".passbook_fuzz_save_file","w");
+ FILE *f = fopen("/dev/null","w");
#else
FILE *f = fopen(filename,"w");
#endif
diff --git a/src/passbook-vuln-2.c b/src/passbook-vuln-2.c
index 9a6227d..2a2ae56 100644
--- a/src/passbook-vuln-2.c
+++ b/src/passbook-vuln-2.c
@@ -364,7 +364,7 @@ int save_levelorder(const node_t *p, const char *masterpw,
const char * filename){
#ifdef PASSBOOK_FUZZ
// ignore the file name when fuzzing etc. to avoid DoS on the server
- FILE *f = fopen(".passbook_fuzz_save_file","w");
+ FILE *f = fopen("/dev/null","w");
#else
FILE *f = fopen(filename,"w");
#endif
diff --git a/src/passbook-vuln-3.c b/src/passbook-vuln-3.c
index 9a6227d..2a2ae56 100644
--- a/src/passbook-vuln-3.c
+++ b/src/passbook-vuln-3.c
@@ -364,7 +364,7 @@ int save_levelorder(const node_t *p, const char *masterpw,
const char * filename){
#ifdef PASSBOOK_FUZZ
// ignore the file name when fuzzing etc. to avoid DoS on the server
- FILE *f = fopen(".passbook_fuzz_save_file","w");
+ FILE *f = fopen("/dev/null","w");
#else
FILE *f = fopen(filename,"w");
#endif
diff --git a/src/passbook-vuln-4.c b/src/passbook-vuln-4.c
index 9a6227d..2a2ae56 100644
--- a/src/passbook-vuln-4.c
+++ b/src/passbook-vuln-4.c
@@ -364,7 +364,7 @@ int save_levelorder(const node_t *p, const char *masterpw,
const char * filename){
#ifdef PASSBOOK_FUZZ
// ignore the file name when fuzzing etc. to avoid DoS on the server
- FILE *f = fopen(".passbook_fuzz_save_file","w");
+ FILE *f = fopen("/dev/null","w");
#else
FILE *f = fopen(filename,"w");
#endif
diff --git a/src/passbook-vuln-5.c b/src/passbook-vuln-5.c
index 9a6227d..2a2ae56 100644
--- a/src/passbook-vuln-5.c
+++ b/src/passbook-vuln-5.c
@@ -364,7 +364,7 @@ int save_levelorder(const node_t *p, const char *masterpw,
const char * filename){
#ifdef PASSBOOK_FUZZ
// ignore the file name when fuzzing etc. to avoid DoS on the server
- FILE *f = fopen(".passbook_fuzz_save_file","w");
+ FILE *f = fopen("/dev/null","w");
#else
FILE *f = fopen(filename,"w");
#endif
diff --git a/src/passbook.c b/src/passbook.c
index 9a6227d..2a2ae56 100644
--- a/src/passbook.c
+++ b/src/passbook.c
@@ -364,7 +364,7 @@ int save_levelorder(const node_t *p, const char *masterpw,
const char * filename){
#ifdef PASSBOOK_FUZZ
// ignore the file name when fuzzing etc. to avoid DoS on the server
- FILE *f = fopen(".passbook_fuzz_save_file","w");
+ FILE *f = fopen("/dev/null","w");
#else
FILE *f = fopen(filename,"w");
#endif
--
GitLab