mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 11:14:39 +00:00
Fix bounds with negative sectors.
This commit is contained in:
@@ -297,7 +297,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector(void *context, const uint64_t se
|
||||
return AARUF_ERROR_NOT_AARUFORMAT;
|
||||
}
|
||||
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1)
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative)
|
||||
{
|
||||
FATAL("Sector address out of bounds");
|
||||
|
||||
@@ -868,7 +868,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_long(void *context, const uint64
|
||||
return AARUF_ERROR_NOT_AARUFORMAT;
|
||||
}
|
||||
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1)
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative)
|
||||
{
|
||||
FATAL("Sector address out of bounds");
|
||||
|
||||
@@ -1509,7 +1509,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_read_sector_tag(const void *context, const u
|
||||
return AARUF_ERROR_NOT_AARUFORMAT;
|
||||
}
|
||||
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1)
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative)
|
||||
{
|
||||
FATAL("Sector address out of bounds");
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector(void *context, uint64_t sector_
|
||||
return AARUF_READ_ONLY;
|
||||
}
|
||||
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1)
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative)
|
||||
{
|
||||
FATAL("Sector address out of bounds");
|
||||
|
||||
@@ -569,7 +569,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_long(void *context, uint64_t se
|
||||
return AARUF_READ_ONLY;
|
||||
}
|
||||
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1)
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative)
|
||||
{
|
||||
FATAL("Sector address out of bounds");
|
||||
|
||||
@@ -2101,7 +2101,7 @@ AARU_EXPORT int32_t AARU_CALL aaruf_write_sector_tag(void *context, const uint64
|
||||
return AARUF_READ_ONLY;
|
||||
}
|
||||
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative - 1)
|
||||
if(negative && sector_address > ctx->user_data_ddt_header.negative)
|
||||
{
|
||||
FATAL("Sector address out of bounds");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user