Opened 17 years ago
Closed 15 years ago
#586 closed Patches (fixed)
iostreams // file_descriptor::seek BUG on files > 4 GB
Reported by: | nobody | Owned by: | Jonathan Turkanis |
---|---|---|---|
Milestone: | Component: | iostreams | |
Version: | None | Severity: | Problem |
Keywords: | Cc: |
Description
Boost 1.33.1 iostreams library file_descriptor::seek() method file_descriptor.cpp, line 198 Win32, Visual C++ 2005 The method seek() can return a wrong value of a newly set offset when the offset is further than 4 GB. //--------------- return offset_to_position((lDistanceToMoveHigh << 32) + dwResultLow); //--------------- The code above has a bug. On 32-bit systems the expression (lDistanceToMoveHigh << 32) equals to lDistanceToMoveHigh. The correct code should first cast the lDistanceToMoveHigh variable to 64-bit and then shift it. //--------------- return (static_cast<boost::intmax_t> lDistanceToMoveHigh) << 32) + dwResultLow; //--------------- Sergey Kolodkin
Change History (4)
comment:2 by , 15 years ago
Component: | None → iostreams |
---|---|
Severity: | → Problem |
comment:4 by , 15 years ago
Resolution: | None → fixed |
---|---|
Status: | assigned → closed |
Both problems are fixed in [42266]
Note:
See TracTickets
for help on using tickets.