Skip to content

Commit 43a8e55

Browse files
authored
fix: 解决安全漏洞 (#62)
Description: 解决有符号整型溢出漏洞 Log: 解决有符号整型溢出漏洞 Task: https://pms.uniontech.com/task-view-197237.html
1 parent dfa81aa commit 43a8e55

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

service/diskoperation/partition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Byte_Value Partition::getByteLength() const
222222

223223
Sector Partition::getSectorLength() const
224224
{
225-
if (m_sectorStart >= 0 && m_sectorEnd >= 0) {
225+
if (m_sectorStart >= 0 && m_sectorEnd >= 0 && m_sectorEnd < ULLONG_MAX) {
226226
return m_sectorEnd - m_sectorStart + 1;
227227
} else {
228228
return -1;

0 commit comments

Comments
 (0)