Skip to content

Commit

Permalink
Fixed a bug with high addresses in operands
Browse files Browse the repository at this point in the history
BUG: High addresses in operands could cause the Python's sqlite3 module to crash when inserting into the database.

The error caused is "OverflowError: Python int too large to convert to SQLite INTEGER".
  • Loading branch information
joxeankoret committed Feb 9, 2024
1 parent 59017c5 commit ee5b628
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions diaphora.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,10 @@ def save_instructions_to_database(self, cur, bb_data, func_id):
cls=CBytesEncoder,
)
)
elif isinstance(instruction_property, int):
if instruction_property > 0x8000000000000000:
instruction_property = str(instruction_property)
instruction_properties.append(instruction_property)
else:
instruction_properties.append(instruction_property)

Expand Down

0 comments on commit ee5b628

Please sign in to comment.