Skip to content

Commit

Permalink
Hotfix max reflexive size logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ShellyHerself committed Nov 4, 2020
1 parent 83f121d commit 3f1fad2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.9.12]
### Changed
- Fix max reflexive size logic.

## [2.9.11]
### Changed
- Change SANE_MAX_REFLEXIVE_COUNT from 0x800000 to 0xFFFE
Expand Down
4 changes: 2 additions & 2 deletions reclaimer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# ##############
__author__ = "Sigmmma"
# YYYY.MM.DD
__date__ = "2020.10.31"
__version__ = (2, 9, 11)
__date__ = "2020.11.05"
__version__ = (2, 9, 12)
__website__ = "https://github.com/Sigmmma/reclaimer"
__all__ = (
"animation", "bitmaps", "h2", "h3", "halo_script", "hek", "meta", "misc",
Expand Down
3 changes: 1 addition & 2 deletions reclaimer/field_type_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ def reflexive_parser(self, desc, node=None, parent=None, attr_index=None,
file_ptr = pointer_converter.v_ptr_to_f_ptr(node[1])
if safe_mode:
# make sure the reflexive sizes are within sane bounds.
node[0] = max(0, max(node[0], s_desc.get(
MAX, SANE_MAX_REFLEXIVE_COUNT)))
node[0] = min(node[0], max(SANE_MAX_REFLEXIVE_COUNT, s_desc.get(MAX, 0)))

if (file_ptr < 0 or file_ptr +
node[0]*s_desc[SUB_STRUCT].get(SIZE, 0) > len(rawdata)):
Expand Down

0 comments on commit 3f1fad2

Please sign in to comment.