Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft Jtest 2020.2

...

Using the write() method to output integers outside the range 0 to 255 will result in truncation.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

FIO09-J

Low

Unlikely

Medium

P2

L3

Automated Detection

Automated detection of all uses of the write() method is straightforward. Sound determination of whether the truncating behavior is correct is not feasible in the general case. Heuristic checks could be useful.

Tool
Version
Checker
Description
Coverity7.5CHECKED_RETURNImplemented
Parasoft Jtest

Include Page
Parasoft_V
Parasoft_V

BD.API.ARGWRITEDo not rely on the write() method to output integers outside the range 0 to 255

Related Guidelines

MITRE CWE

CWE-252, Unchecked Return Value

Bibliography

[API 2014]

Class OutputStream
   Method write()

[Harold 1999]

 

...



...