Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Code Block
sa[rl]l   %cl, %eax

Wiki MarkupThe {{sa\[rl\]l}} instructions take a bit mask of the least significant 5 bits from {{%cl}} to produce a value in the range \ [0, 31\] and then shift {{%eax}} that many bits.

Code Block
64 bit shifts become
sh[rl]dl  %eax, %edx
sa[rl]l   %cl, %eax

...

Tool

Version

Checker

Description

Section

LDRA tool suite

Include Page
c:LDRA_Vc:
LDRA_V
Section

403 S

Section

Partially Implemented

Fortify SCA

V. 5.0

 

can detect violations of this rule with CERT C Rule Pack

Compass/ROSE

 

 

can detect violations of this rule. Unsigned operands are detected when checking for recommendation INT13-C. Use bitwise operators only on unsigned operands

...

A test program for this rule is available at www.securecoding.cert.orgunmigrated-wiki-markup

\[[Dowd 2006|AA. Bibliography#Dowd 06] \] Chapter 6, "C Language Issues" \
[[Seacord 2005a|AA. Bibliography#Seacord 05]\] Chapter 5, "Integers" \[
[Viega 2005|AA. Bibliography#Viega 05]\] Section 5.2.7, "Integer overflow"

...

INT33-C. Ensure that division and modulo operations do not result in divide-by-zero errors      04. Integers (INT)      INT35-C. Evaluate integer expressions in a larger size before comparing or assigning to that size