Skip to content

Commit

Permalink
File name length validation etc
Browse files Browse the repository at this point in the history
* Added some overrun checks for numeric calculations in CDBuilder.
Ref: #20
  • Loading branch information
LTRData committed Nov 23, 2024
1 parent eb1def3 commit c1408cc
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 188 deletions.
2 changes: 1 addition & 1 deletion Library/DiscUtils.Iso9660/BuildDirectoryInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal uint GetPathTableEntrySize(Encoding enc)
{
var nameBytes = enc.GetByteCount(PickName(null, enc));

return (uint)(8 + nameBytes + ((nameBytes & 0x1) == 1 ? 1 : 0));
return checked((uint)(8 + nameBytes + ((nameBytes & 0x1) == 1 ? 1 : 0)));
}

internal int Write(Span<byte> buffer, Dictionary<BuildDirectoryMember, uint> locationTable, Encoding enc)
Expand Down
Loading

0 comments on commit c1408cc

Please sign in to comment.