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

SonarCloudにBugだと言われている範囲外アクセスに対処する #1595

Merged
merged 2 commits into from
Mar 20, 2021

Conversation

berryzplus
Copy link
Contributor

PR の目的

SonarScanで検出されたBugsレベル警告に対処します。

カテゴリ

  • リファクタリング

PR の背景

SonarCloudで以下のようなBugsレベル警告が検出されています。

Out of bound memory access (accessed memory precedes memory block)
https://sonarcloud.io/project/issues?id=sakura-editor_sakura&issues=AW8eyiAzak1yqJchwkvL&open=AW8eyiAzak1yqJchwkvL

PR のメリット

SonarCloudのBugsレベル警告が3つ解消します。

PR のデメリット (トレードオフとかあれば)

とくにありません。
パフォーマンス問題は、気付かなかったことにします。

仕様・動作説明

文字列末尾に1文字追加してNUL終端するコードが指摘されています。
 👇
追加したい1文字のみで構成される「文字列」を用意してstrcatします。

PR の影響範囲

テスト内容

ビルド確認のみです。

関連 issue, PR

#1504

参考資料

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@AppVeyorBot
Copy link

@berryzplus
Copy link
Contributor Author

レビューありがとうございます。マージしちゃいます。

@berryzplus berryzplus merged commit 1960cbc into sakura-editor:master Mar 20, 2021
@berryzplus berryzplus deleted the feature/fix_out_of_range branch March 20, 2021 09:34
@beru beru added the refactoring リファクタリング 【ChangeLog除外】 label Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring リファクタリング 【ChangeLog除外】
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants