Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions sonar-cxx-plugin/src/main/resources/rats.xml
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,20 @@ Follow these steps to make your custom Custom rules available in SonarQube:
<tag>security</tag>
</rule>

<rule>
<key>strncat</key>
<name>strncat</name>
<description>
Double check that your buffer is as big as you specify. When
using functions that accept a number n of bytes to copy, such as
strncpy, be aware that if the destination buffer size = n it may not
NULL-terminate the string.
</description>
<priority>MAJOR</priority>
<configKey>config/StrNCat</configKey>
<tag>security</tag>
</rule>

<rule>
<key>StrNCat</key>
<name>StrNCat</name>
Expand Down Expand Up @@ -2631,6 +2645,21 @@ Follow these steps to make your custom Custom rules available in SonarQube:
<tag>security</tag>
</rule>

<rule>
<key>swscanf</key>
<name>swscanf</name>
<description>
Check to be sure that the format string passed as argument 2 to
this function call does not come from an untrusted source that could
have added formatting characters that the code is not prepared to
handle. Additionally, the format string could contain `%s' without
precision that could result in a buffer overflow.
</description>
<priority>MAJOR</priority>
<configKey>config/sscanf</configKey>
<tag>security</tag>
</rule>

<rule>
<key>fscanf</key>
<name>fscanf</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public void createRulesTest() {
def.define(context);

RulesDefinition.Repository repo = context.repository(CxxRatsRuleRepository.KEY);
assertThat(repo.rules()).hasSize(301);
assertThat(repo.rules()).hasSize(303);
}
}