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

Reading a float as an int #6

Closed
andresriancho opened this issue Mar 6, 2014 · 2 comments
Closed

Reading a float as an int #6

andresriancho opened this issue Mar 6, 2014 · 2 comments

Comments

@andresriancho
Copy link

https://code.google.com/p/jrfonseca/issues/detail?id=93 explains the issue well:

  1. on OSX using w3af itwill throw an error about:
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/xdot.py", line 494, in read_number
    return int(self.read_code())

Upon opening the file i located the function read_number(). It is typcasting to an int from a string, therefore failing. To fix this I modified the function from:

def read_number(self):
    return int(self.read_code())

to:

def read_number(self):
    return int(float(self.read_code()))

It now evaluates the string, to a float first, then to an int()

Your code has changed a little bit now and instead of read_number you've got read_int, but I guess the same issue applies.

Users have reported this on the w3af project repository in the past andresriancho/w3af#1327 andresriancho/w3af#1089

I could send you a pull request with the changes that vekt0r@me.com proposes, but first I would like to know if you believe that this will fix the issue and you'll actually merge it.

@andresriancho
Copy link
Author

A careful review of your code shows that some of your read_number were translated to read_float instead of read_int... hmmm... looks like this issue should be already fixed in 0.6. Could you confirm?

@jrfonseca
Copy link
Owner

Thanks for feedback.

Yes, I believe this was fixed in e36b49b .

If you want to be extra sure, please provide the output of dot -T xdot ... and I'll check it.

Please update w3af's copy of xdot.py to the latest version.

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

No branches or pull requests

2 participants