Rule Definition
This includes file and I/O functions fgetpos, fopen, ftell, gets, perror, remove, rename, etc.
Streams and file I/O have a large number of unspecified, undefined and implementation-defined behaviors associated with them.
Remediation
Use
Violation Code Sample
#include <cstdio> // Non-compliant
void fn ( )
{
char_t array [ 10 ];
gets ( array ); // Can lead to buffer over-run
}
Reference
Standards Reference:
MISRA C++ 2008, 27-0-1: The stream input/output library shall not be used.
Related Technologies
Technical Criterion
CWE-758 - Reliance on Undefined, Unspecified, or Implementation-Defined Behavior
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.