National Institute of Standards and Technology
Package illustrating a test case

Test case 1498

Description

Extracting object from cin to std::string object. This example is quite safe because if there is a buffer overflow, C++ will throw a out_of_range exception.
From "Secure Coding in C and C++" by Robert C. Seacord.
Page 61, Figure 2-33

Flaws

Have any comments on this test case? Please, send us an email.