Avoid numerical data corruption during incompatible mutation | CAST Appmarq

Avoid numerical data corruption during incompatible mutation

CRITICAL

Rule Definition
Software featuring weak numerical conversion practices incurs the risk of using the wrong number and generating incorrect results, possibly introducing new vulnerability when related to resource allocation and security decision.

Remediation
Change the data type.

Violation Code Sample
Waiting for examples
Fixed Code Sample
DATA myChar1(9) TYPE c.
DATA myChar2(9) TYPE c.
myChar1 = myChar2.
------------------------------------------------
DATA myDate TYPE d.
DATA myChar(8) TYPE c.
myDate = myChar.
-------------------------------------------------
DATA myDate TYPE d.
DATA myChar(8) TYPE c.
MOVE myChar to myDate.
-------------------------------------------------
DATA myTime TYPE t.
DATA myChar(6) TYPE c.
myChar= myTime.
-------------------------------------------------
DATA myFloat TYPE f.
DATA myChar(6) TYPE c.
myChar= myFloat.

Reference
ASCSM 1.0, Automated Source Code Security Measure, Object Management Group.

Related Technologies

Health Factor

  Total Quality Index


Technical Criterion
CWE-681 - Incorrect Conversion between Numeric Types

About CAST Appmarq

CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.

Benchmark Statistics

Global Compliance

99.92%

Total Violations
1,306
Total Opportunities
1,720,201
Average Violations / App.
40.81
The compliance score represents 1 minus the ratio between the number of times a rule has been violated compared to the number of opportunities in a set of applications that the rule could have been violated.

Industry Insights

Energy

99.93%

IT & Business Consulting

99.85%

Telecommunications

99.90%