Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix crash caused by too long mount path #115

Merged

Conversation

wangrong1069
Copy link
Contributor

The anything server will get the partition list when creating the file index. If the mount path is too long, it will cause a buffer overflow. The solution is to use the dynamic allocation conversion specifier.

Log: fix crash caused by too long mount path
Bug: https://pms.uniontech.com/bug-view-262789.html

The anything server will get the partition list when creating the file
index. If the mount path is too long, it will cause a buffer overflow.
The solution is to use the dynamic allocation conversion specifier.

Log: fix crash caused by too long mount path
Bug: https://pms.uniontech.com/bug-view-262789.html
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • get_partitions函数中,每次循环结束后没有重新初始化dev, mp, fs_type变量,可能导致后续使用时出现未初始化的问题。
  • 使用strlen检查字符串长度可能会导致性能问题,特别是在频繁调用的情况下。
  • while循环中,每次循环都会调用free函数释放内存,这可能会导致不必要的性能开销。
  • 缺少对fscanf函数返回值的检查,可能会导致未处理的读取错误。

是否建议立即修改:

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: re2zero, wangrong1069

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

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

@wangrong1069
Copy link
Contributor Author

/merge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Jul 4, 2024

This pr cannot be merged! (status: unstable)

@wangrong1069
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Jul 4, 2024

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit dc7daa8 into linuxdeepin:master Jul 4, 2024
17 of 18 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