LinearTapeFileSystem / ltfs

Reference implementation of the LTFS format Spec for stand alone tape drive
BSD 3-Clause "New" or "Revised" License
257 stars 76 forks source link

Fix potential use after free issues #462

Closed piste-jp closed 6 months ago

piste-jp commented 6 months ago

The problem was found by code scan. Use delete safe iteration instead.

Summary of changes

This pull request includes following changes or fixes.

Description

The CodeQL on the GitHub found three potential use after free issues. All are same flavor, it means, use a pointer after free. So change the logic from normal iteration to delete safe iteration.

This fix might be good to merge to the v2.4-stable branch also.

Fixes #457

Type of change

Checklist: