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

Session.fuzz_by_name is deprecated in favor of Session.fuzz(name=name). #640

Closed
hackathi opened this issue Aug 17, 2022 · 1 comment · Fixed by #689
Closed

Session.fuzz_by_name is deprecated in favor of Session.fuzz(name=name). #640

hackathi opened this issue Aug 17, 2022 · 1 comment · Fixed by #689
Labels

Comments

@hackathi
Copy link
Contributor

Report

Session.fuzz_by_name unconditionally emits the following warning:

Session.fuzz_by_name is deprecated in favor of Session.fuzz(name=name).

However, if you look at the source code of Session.fuzz(name="something"), you'll find this:

boofuzz/boofuzz/sessions.py

Lines 1280 to 1291 in 5ee41f8

if name is None or name == "":
self._main_fuzz_loop(self._generate_mutations_indefinitely(max_depth=max_depth))
else:
self.fuzz_by_name(name=name)
def fuzz_by_name(self, name):
"""Fuzz a particular test case or node by name.
Args:
name (str): Name of node.
"""
warnings.warn("Session.fuzz_by_name is deprecated in favor of Session.fuzz(name=name).")

So the "correct" way to call this will trigger the warning.

Expected behavior

No warning if the correct method is used.

Actual behavior

Warning is displayed regardless of method used.

Steps to reproduce the problem

  1. use session.fuzz(name="anything")

boofuzz script

No response

boofuzz version

No response

Python version

No response

Platform

No response

Anything else?

Proposed solution: move the code that is in fuzz_by_name() to fuzz(), let fuzz_by_name() call fuzz(name=name) instead.

@hackathi hackathi added the bug label Aug 17, 2022
@jtpereyda
Copy link
Owner

Thanks for the bug! The proposed solution makes sense to me.

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

Successfully merging a pull request may close this issue.

2 participants