fix: [export_mod/goamlexport] fix typo'd dict name in introspection() - #889
Open
elhoim wants to merge 1 commit into
Open
fix: [export_mod/goamlexport] fix typo'd dict name in introspection()#889elhoim wants to merge 1 commit into
elhoim wants to merge 1 commit into
Conversation
introspection() builds its result in a dict named modulesetup, but the
inputSource branch assigns into moduleSetup instead (wrong capitalization).
This is currently latent because the preceding `inputSource` bare-name
existence check already raises NameError and is caught, so the buggy line
never executes today; but the moment a caller defines module-level
inputSource, the function would raise NameError('moduleSetup is not
defined') instead of returning the introspection dict with inputSource
included, breaking module setup reporting for any export module relying on
that field.
Verified with flake8 (clean) and the full pytest suite against a live
misp-modules server on port 6780: 161 passed, 4 skipped, 5 subtests passed,
matching baseline.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018dfYpyaSZd1nxSRLr8suj8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
misp_modules/modules/export_mod/goamlexport.py'sintrospection()has a typo that writes to the wrong dict name:moduleSetup(capitalS) does not exist anywhere in the function — the dict actually built and returned ismodulesetup. Today this is latent: the bareinputSourcereference on the preceding line raisesNameErrorfirst (sinceinputSourceis never defined at module scope), so the buggy assignment is never reached. But ifinputSourcewere ever defined at module scope, the function would crash withNameError: name 'moduleSetup' is not definedinstead of returning module setup info, breakingintrospection()for this export module and anything depending on its output (e.g. the misp-modules server's module listing).Fix: changed
moduleSetuptomodulesetupso the assignment targets the dict that is actually built and returned, matching the pattern used by the other threetry/except NameErrorblocks in the same function.No behaviour change for the current codebase (the branch is unreachable as written); this only prevents a future crash if
inputSourceis ever added.Verification
flake8on the changed file: clean (exit 0)Found during a review of the repository; other findings are being submitted as separate PRs.
🤖 Generated with Claude Code
https://claude.ai/code/session_018dfYpyaSZd1nxSRLr8suj8