Skip to content

Fix memory leaks related to the cache of securityStateReference. #143

Open
y-iwata-bl wants to merge 5 commits into
lextudio:mainfrom
y-iwata-bl:fixed_cache_leak
Open

Fix memory leaks related to the cache of securityStateReference. #143
y-iwata-bl wants to merge 5 commits into
lextudio:mainfrom
y-iwata-bl:fixed_cache_leak

Conversation

@y-iwata-bl

Copy link
Copy Markdown

Sorry for my late response.
Here is a pull request to fix the issue #93.

@CLAassistant

CLAassistant commented Nov 6, 2024

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lextm lextm added the priority:low Low priority items. label Nov 7, 2024
@lextm

lextm commented Nov 7, 2024

Copy link
Copy Markdown

It isn't written in an ideal way as you put too many changes in one commit without any test cases. Thus, it's going to take a while for us to review before accepting it.

@lextm

lextm commented Nov 7, 2024

Copy link
Copy Markdown

Enabled the previous test case written for #93.

There are another 11 changes, and each requires a new test case.

@lextm

lextm commented Nov 8, 2024

Copy link
Copy Markdown

Instead of accepting this pull request as a whole, I decided to cherry-pick the necessary changes required by #93 first and shipped in release 7.1.13 with its test case. That branch might be hit more often, so shipping the fix earlier would make more sense.

Other changes, though useful, are associated with rarer cases that are much harder to trigger (and tested by test cases). So, I can gradually cherry-pick the rest when new test cases are created.

elif securityLevel == 3:
msgFlags |= 0x03
else:
if securityModel in snmpEngine.security_models:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

def prepare_data_elements in rfc3412.py already blocked invalid msgFlags from being passed on, so it is impossible to have a securityLevel value here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:pysnmp PySNMP package bug Something isn't working priority:low Low priority items.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants