summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2022-01-27 09:04:41 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2022-01-27 09:04:41 +0100
commit4d988b1c2f457388aa69fe61b7a3e213ced6a12e (patch)
tree7d4187d97d4bfd232d0ccabf5ab3b8856badc2db
parent61f7103e0dcdf80f4b5bdba208532716522c4bd7 (diff)
Stops if argc <= 0HEADmaster
-rw-r--r--src/phmain.c2
-rw-r--r--src/testdisk.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/phmain.c b/src/phmain.c
index 230db57..9e622ed 100644
--- a/src/phmain.c
+++ b/src/phmain.c
@@ -168,6 +168,8 @@ int main( int argc, char **argv )
.list_file_format=array_file_enable
};
struct ph_param params;
+ if(argc <= 0)
+ return 1;
params.recup_dir=NULL;
params.cmd_device=NULL;
params.cmd_run=NULL;
diff --git a/src/testdisk.c b/src/testdisk.c
index 6c4b8ac..acbfb85 100644
--- a/src/testdisk.c
+++ b/src/testdisk.c
@@ -233,6 +233,8 @@ int main( int argc, char **argv )
const char *logfile="testdisk.log";
int log_opened=0;
int log_errno=0;
+ if(argc <= 0)
+ return 1;
/* srand needed for GPT creation (weak is ok) */
srand(time(NULL));
#ifdef HAVE_SIGACTION