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

Exception for max_length(0) < 0 for boolean fuzzer #67

Open
abnair24 opened this issue Nov 3, 2023 · 2 comments
Open

Exception for max_length(0) < 0 for boolean fuzzer #67

abnair24 opened this issue Nov 3, 2023 · 2 comments
Labels

Comments

@abnair24
Copy link

abnair24 commented Nov 3, 2023

Describe the bug

Below error observed on execution.

fuzzer_type: boolean fuzzer: RandomBitsField

94093 [ ERROR] APIFuzzer [fuzzer.py:47 - prepare ]: Exception: max_length(0) < 0
Traceback (most recent call last):
File "/.pyenv/versions/3.9.0/lib/python3.9/site-packages/apifuzzer/fuzzer.py", line 45, in prepare
template_generator.process_api_resources()
File "
/.pyenv/versions/3.9.0/lib/python3.9/site-packages/apifuzzer/openapi_template_generator.py", line 110, in process_api_resources
self._process_api_resources()
File "/.pyenv/versions/3.9.0/lib/python3.9/site-packages/apifuzzer/openapi_template_generator.py", line 252, in _process_api_resources
fuzz_type(
File "
/.pyenv/versions/3.9.0/lib/python3.9/site-packages/apifuzzer/custom_fuzzers.py", line 112, in init
super(RandomBitsField, self).init(
File "/.pyenv/versions/3.9.0/lib/python3.9/site-packages/kitty/model/low_level/field.py", line 1114, in init
self._validate_lengths(min_length, max_length)
File "
/.pyenv/versions/3.9.0/lib/python3.9/site-packages/kitty/model/low_level/field.py", line 1135, in _validate_lengths
raise KittyException('max_length(%d) < 0' % (max_length))
kitty.core.KittyException: max_length(0) < 0
Unexpected exception happened during fuzz test preparation: max_length(0) < 0. Feel free to report the issue

APIFuzzer debug log

Please provide the related APIFuzzer debug log

Related API definition

Please provide only the minimal but valid API definition which causes the issue

Software environment (please complete the following information):

  • OS: Mac
  • Python version: 3.9
  • APIFuzzer Version: 0.9.13

Additional context

Add any other context about the problem here.

@KissPeter KissPeter added the bug label Nov 9, 2023
@KissPeter
Copy link
Owner

Can you provide a snippet from the API definition causing this?

@abnair24
Copy link
Author

abnair24 commented Nov 9, 2023

@KissPeter
Pls find the below header from the apispec which causing the issue

"parameters":[ {
            "name": "ENABLE-DEBUG",
            "in": "header",
            "description": "ENABLE-DEBUG",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }]```

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

No branches or pull requests

2 participants