Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

ENV30-C

Low

Probable

Medium

P4

L3

Automated Detection

Tool

Version

Checker

Description

Compass/ROSE

Can detect violations of this rule. In particular, it ensures that the result of getenv() is stored in a const variable

LDRA tool suite
Include Page
LDRA_V
LDRA_V
107 DPartially Implemented
Parasoft C/C++test

Include Page
Parasoft_V
Parasoft_V

CERT_C-ENV30-a

The pointers returned by the Standard Library functions 'localeconv', 'getenv', 'setlocale' or, 'strerror' shall only be used as if they have pointer to const-qualified type

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

Modification of internal buffer returned from nonreentrant standard function

MISRA C:2012 Rule 21.19

Function attempts to modify internal buffer returned from a nonreentrant standard function

The pointers returned by the Standard Library functions localeconvgetenvsetlocale or strerror shall only be used as if they have pointer to const-qualified type

 PRQA QA-C9.1 1492, 1493 

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

...