Skip to content

[BUG] Missing Bounds Checking in Index-Based Getter Functions in load_config.py #79

@santhil-cyber

Description

@santhil-cyber

What's Happening

All five index-based getter functions in load_config.py accept an index argument but perform no bounds checking before accessing the underlying file list. Passing an out-of-range index results in a raw, unhelpful Python IndexError with no context about what valid values actually are — making debugging unnecessarily painful for users.

The affected functions are:

  • get_image_path() — lines 30–35
  • get_raw_data_path() — lines 37–42
  • get_shapefile_path() — lines 44–49
  • get_ground_truth_path() — lines 51–56
  • get_aligned_data_path() — lines 58–63

Steps to Reproduce

Call any of the above functions with an index that exceeds the length of the configured file list. The function will crash immediately with a generic IndexError and no indication of what the valid range is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions