[PR #1182] [MERGED] Improve dataset extraction robustness #1158

Closed
opened 2026-03-22 16:02:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1182
Author: @RinZ27
Created: 2/19/2026
Status: Merged
Merged: 2/22/2026
Merged by: @profvjreddi

Base: devHead: fix/safe-data-extraction


📝 Commits (1)

  • 7d2cd5a Improve robustness of dataset extraction by validating paths

📊 Changes

1 file changed (+14 additions, -1 deletions)

View changed files

📝 tinytorch/milestones/data_manager.py (+14 -1)

📄 Description

Updated the dataset extraction logic in data_manager.py to include path validation. This ensures that when extracting the CIFAR-10 dataset, all members are strictly contained within the target directory, preventing potential file system issues or unintended overwrites. I noticed the current implementation uses extractall() directly, so adding this check makes the process much more robust for students working with the framework.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1182 **Author:** [@RinZ27](https://github.com/RinZ27) **Created:** 2/19/2026 **Status:** ✅ Merged **Merged:** 2/22/2026 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `fix/safe-data-extraction` --- ### 📝 Commits (1) - [`7d2cd5a`](https://github.com/harvard-edge/cs249r_book/commit/7d2cd5a47dca76d30345c72bb356f9fd1ca140e0) Improve robustness of dataset extraction by validating paths ### 📊 Changes **1 file changed** (+14 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tinytorch/milestones/data_manager.py` (+14 -1) </details> ### 📄 Description Updated the dataset extraction logic in `data_manager.py` to include path validation. This ensures that when extracting the CIFAR-10 dataset, all members are strictly contained within the target directory, preventing potential file system issues or unintended overwrites. I noticed the current implementation uses `extractall()` directly, so adding this check makes the process much more robust for students working with the framework. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 16:02:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#1158