Fix #295: IDA PRO crash#326
Merged
mrexodia merged 1 commit intomrexodia:mainfrom Apr 2, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
What version of IDA are you using? |
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.
Closes #295
Before
decompile_function_safeinsrc/ida_pro_mcp/ida_mcp/utils.pycalledcfunc.get_line_item(sl.line, 0, False, None, item, None), passingNonefor thepheadandptailoutput parameters. IDA'sget_line_itemattempts to write through these pointers; passingNoneresults in a null-pointer write, causing IDA Pro to crash silently during any MCP-triggered decompilation.After
pheadandptailare now backed by realctree_item_tinstances (_headand_tail) allocated before the call:get_line_itemhas valid memory to write into for all three output parameters, eliminating the crash.Changes
src/ida_pro_mcp/ida_mcp/utils.py(decompile_function_safe, line ~1031): Replaced bothNonearguments in theget_line_itemcall with allocatedctree_item_tobjects_headand_tail.src/ida_pro_mcp/ida_mcp/tests/test_utils.py(test_utils_stack_frame_and_decompile_helpers): Added an assertion that the decompiled output contains address annotations (/*0x...*/), which are produced byget_line_itemand confirm the call is succeeding and writing through all output parameters correctly.Testing
The new assertion in
test_utils_stack_frame_and_decompile_helpersverifies thatget_line_itemis returning line address annotations for thesum_pointfunction intyped_fixture.elf:This would fail if
get_line_itemwere not populating results correctly. Manual verification: decompiling a function via the MCPdecompiletool no longer crashes IDA Pro.