30/09/2018, 16:02

How to fix_CRT_SECURE_NO_WARNINGS

Mình đang làm 1 project MFC và được yêu cầu fix warning này. Lý do của thông điệp cảnh báo mình tìm được:

"C/C++ doesn’t support any build in data type for strings. C/C++ treats string as array of characters. But, C++ can make use of Standard Template Library string class. The security should be considered when the application uses both standard template library (STL) and C style strings. The C style strings are NULL terminated. The Windows C/C++ programmers have many options for string handling. The developers can use C Run time library (CRT) (strcpy, strcmp, etc), Windows string functions (lstrcmp, lstrcpy, etc), C++ STL and MFC/ATL library String functions. Microsoft increased security for all the string functions because most of the application security attack is based on buffer overflow.

Microsoft released Strsafe functions for increased Windows applications security. Later, Microsoft enhanced the CRT libraries for increased security. It helps the developers build secured applications and Microsoft uses those functions internally too. Microsoft rebuilds the ATL and MFC libraries for making use of secured C run time functions. So, if developers rebuild their applications by using new versions of MFC and ATL, they will make sure the applications use secured version libraries.

The Secure string handling comes under Secure Development Lifecycle (SDL) Practice #9: Deprecate Unsafe Functions. Microsoft SDL recommends making use of Banned.H, Strsafe.h (with Visual Studio) and Safe CRT (with Visual Studio). The National Institute of Standards and Technology (NIST) states that designing the secured software during the early stage can cost 30 times less than fixing them post release."

Mong được bạn nào hiểu về warning này vui lòng giúp mình hiểu nguyên nhân và cách giải quyết .
Thân

Nguyễn Minh Dũng viết 18:18 ngày 30/09/2018

Cái này giống với cái bạn đang mắc phải nè,làm theo hướng dẫn xem

stackoverflow.com
Juan Martinez

Remove secure warnings (_CRT_SECURE_NO_WARNINGS) from projects by default in Visual Studio

c++, visual-studio, precompiler
asked by Juan Martinez on 01:05PM - 02 Jun 13

Bài liên quan
0