summaryrefslogtreecommitdiffstats
path: root/src/dirpart.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-02-07 18:12:38 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2018-02-07 18:12:38 +0100
commit78380d72f73557646907bd7f92e6e7d5fd68a1af (patch)
tree64eef70086c14a5a9e2bba8b4c54e71217e22943 /src/dirpart.c
parente1d86c408e1c3a248b86b13b517a0b52a48f3e4c (diff)
Avoid a NULL dereference when listing an NTFS partition after RebuildBS
Diffstat (limited to 'src/dirpart.c')
-rw-r--r--src/dirpart.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dirpart.c b/src/dirpart.c
index d3d5699..7380dd5 100644
--- a/src/dirpart.c
+++ b/src/dirpart.c
@@ -122,7 +122,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
log_partition(disk,partition);
screen_buffer_add("Support for this filesystem hasn't been implemented.\n");
screen_buffer_to_log();
- if(*current_cmd==NULL)
+ if(current_cmd==NULL || *current_cmd==NULL)
{
#ifdef HAVE_NCURSES
screen_buffer_display(window,"",NULL);
@@ -139,7 +139,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
log_partition(disk,partition);
screen_buffer_add("Support for this filesystem wasn't enabled during compilation.\n");
screen_buffer_to_log();
- if(*current_cmd==NULL)
+ if(current_cmd==NULL || *current_cmd==NULL)
{
#ifdef HAVE_NCURSES
screen_buffer_display(window,"",NULL);
@@ -156,7 +156,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
log_partition(disk,partition);
screen_buffer_add("Can't open filesystem. Filesystem seems damaged.\n");
screen_buffer_to_log();
- if(*current_cmd==NULL)
+ if(current_cmd==NULL || *current_cmd==NULL)
{
#ifdef HAVE_NCURSES
screen_buffer_display(window,"",NULL);
@@ -167,7 +167,7 @@ dir_partition_t dir_partition(disk_t *disk, const partition_t *partition, const
{
int recursive=0;
int copy_files=0;
- if(*current_cmd!=NULL)
+ if(current_cmd!=NULL && *current_cmd!=NULL)
{
int do_continue;
do