Query module DangerousUseOfCin

name
Dangerous use of ‘cin’
description
Using cin without specifying the length of the input may be dangerous.
kind
problem
problem.severity
error
precision
high
id
cpp/dangerous-cin
tags
reliability security external/cwe/cwe-676 external/cwe/cwe-242

Imports

cpp

Provides classes and predicates for working with C/C++/ObjC/ObjC++ code.

Predicates

Classes

AnyCharArrayType

A C/C++ char[] or wchar_t[] type.

AnyCharPointerType

A C/C++ char* or wchar_t* type.

AnyStdStringType

A C++ std::basic_string type (the underlying type of std::string and std::wstring).

ChainedInput

A chained call to std::operator>> on a potentially dangerous input.

CinAccess

A direct access to std::cin or std::wcin.

CinVariable

The variable std::cin or std::wcin.

IFStream

A C++ std::basic_ifstream type (the underlying type of std::ifstream and std::wifstream).

IFStreamAccess

A direct access to a variable of type std::ifstream or std::wifstream.

OperatorRShiftCall

A call to std::operator>>.

PotentiallyDangerousInput

A potentially dangerous std::istream or std::wistream, for example, an access to std::cin.