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

rx_filter needs to check size of data[] before parsing #174

Open
rmccourt opened this issue Sep 7, 2024 · 1 comment
Open

rx_filter needs to check size of data[] before parsing #174

rmccourt opened this issue Sep 7, 2024 · 1 comment

Comments

@rmccourt
Copy link

rmccourt commented Sep 7, 2024

In interfaces/ipmb.py, the rx_filter function assumes that all the fields are present in the data array. If that's not the case, then the code crashes. I was able to fix it by adding a check at line 241 if len(data) < 7: return False

Not sure if it's unique to my setup, but the Aardvark I am using consistently seems to return just the address byte on the first iteration of the polling loop when looking for an IPMB response. Then the rx_filter code tries to index off the end of data[] and bombs out.

The real fix maybe needs more sophistication (or at least not just a magic number) - not totally sure. I guess I'm hoping that pointing this out will let somebody more knowledgeable drop in a real fix.

Thanks

@hthiery
Copy link
Contributor

hthiery commented Sep 9, 2024

Hi, you're right .. hanling an invalid length of data is not yet really implemented. Could you please create a PR with your thoughts and let discuss this there.

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