Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed build_recursive_tree() #1866

Merged
merged 1 commit into from
Feb 4, 2020
Merged

Conversation

superuserx
Copy link

Thanks for submitting a PR! Please fill in this template where appropriate:

Category

Bug

Feature/Issue Description

There was a bug in the build_recursive_tree function, which was triggered when you
tried to generate folders which only contained subfolders (without modules).

@jcrew99
Copy link
Collaborator

jcrew99 commented Jan 30, 2020

@superuserx Can you please expand on the steps to reproduce the bug and describe the bug more?

@superuserx
Copy link
Author

Steps to reproduce

  • generate a folder in /modules (e.g. Cve_db)
  • generate one or more subfolders in that new folder (folders with the command.js, config.yaml and module.rb files) like this:
    beef_fixed
  • start beef and try to open the module tree

Result: the UI will not load the modules and you will see an error message/stacktrace in the commandline

If you put a module next to the subfolders like this:
beef_broken
It will work.

Bug
The problem is that if you have a directory which only has subfolders in it, the build_recursive_tree function creates an entry for the root folder ("Cve_db") but instead of attaching it to the tree, it makes the next recursive call with that entry as parameter.
The bug isn't triggered when you have a module in the directory next to the subfolders because than it will attach the entry of the root folder when iterating on that module.

Copy link
Collaborator

@jcrew99 jcrew99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reviewed it and got the same issue and no longer have it as well with the change plus the tests pass so its fine to merge.

@jcrew99 jcrew99 merged commit 714e320 into beefproject:master Feb 4, 2020
@jcrew99
Copy link
Collaborator

jcrew99 commented Feb 4, 2020

@superuserx nice work! Have you thought about doing more dev work on beef?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants