Skip to content

Conversation

@tsic404
Copy link
Contributor

@tsic404 tsic404 commented Dec 12, 2024

The model's boundary processing error causes the data to be changed out of bounds

log: as title
pms: BUG-292027

cherry-pick #929

The model's boundary processing error causes the data to be changed out of bounds

log: as title
pms: BUG-292027
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. abstractwindowmonitor.cpp文件中,beginInsertRows函数的第二个参数和第三个参数相同,这可能是一个错误。正确的应该是第二个参数是插入行的起始索引,第三个参数是结束索引,这里应该是m_trackedWindows.size() + 1

  2. rolecombinemodel.cpp文件中,rowsInsertedcolumnsInsertedrowsRemovedcolumnsRemoved信号的处理函数中,循环的终止条件从<改为<=,这可能会导致索引越界错误。应该检查last是否是有效的索引,然后再进行循环。

  3. rolecombinemodel.cpp文件中,m_indexMap.remove(qMakePair(i, 0))m_indexMap.remove(qMakePair(0, j))可能会删除不存在的键,应该先检查键是否存在。

  4. rolecombinemodel.cpp文件中,index(parent.row(), parent.column())可能会返回一个无效的索引,应该检查parent是否是一个有效的索引。

  5. rolecombinemodel.cpp文件中,majorIndex.isValid()minorIndex.isValid()的检查应该放在循环内部,而不是循环外部,以确保每次迭代都检查索引的有效性。

  6. rolecombinemodel.cpp文件中,m_indexMap的使用可能存在线程安全问题,如果RoleCombineModel是一个多线程环境下的模型,应该考虑使用线程安全的容器。

  7. rolecombinemodel.cpp文件中,beginInsertRowsbeginRemoveRowsbeginInsertColumnsbeginRemoveColumns函数的使用应该确保在调用这些函数之前,模型的状态是正确的,以避免潜在的崩溃或未定义行为。

  8. rolecombinemodel.cpp文件中,sourceModel()函数的调用应该确保在模型被销毁之前,源模型仍然存在,以避免潜在的崩溃或未定义行为。

  9. rolecombinemodel.cpp文件中,index函数的调用应该确保在模型被销毁之前,模型的状态是正确的,以避免潜在的崩溃或未定义行为。

  10. rolecombinemodel.cpp文件中,func函数的调用应该确保在模型被销毁之前,函数仍然可用,以避免潜在的崩溃或未定义行为。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, tsic404

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tsic404
Copy link
Contributor Author

tsic404 commented Dec 13, 2024

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Dec 13, 2024

This pr force merged! (status: behind)

@deepin-bot deepin-bot bot merged commit 3f80277 into linuxdeepin:master Dec 13, 2024
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants