Skip to content

Commit 73a29cd

Browse files
TylerMSFTTylerMSFT
authored andcommitted
acrolinx updates
1 parent ed2f0d0 commit 73a29cd

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

docs/c-runtime-library/internationalization.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ ms.assetid: ee536a04-3558-4729-8e10-6dabcde055fd
99

1010
# Internationalization
1111

12-
The Microsoft runtime library provides many routines that you can use to customize your app for international markets. This includes [locale-related routines](../c-runtime-library/locale.md), wide-character routines, multibyte-character routines, and generic-text routines.
12+
The Microsoft runtime library provides many routines that you can use to customize your app for international markets such as:
13+
- [locale-related routines](../c-runtime-library/locale.md)
14+
- wide-character routines
15+
- multibyte-character routines
16+
- generic-text routines
1317

14-
For convenience, most locale-related routines are also categorized by what they do.
18+
For convenience, most locale-related routines are also categorized by what they do.
1519

16-
In this section, and in the alphabetic reference, multibyte and wide-character routines are described along with their single-byte-character counterparts, when they exist.
20+
Multibyte routines and wide-character routines are described alongside their single-byte-character counterparts, when they exist.
1721

1822
ISO646 operator alternatives are also included.
1923

docs/c-runtime-library/security-features-in-the-crt.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Security Features in the CRT"
33
description: "An overview of secure CRT functions in the Microsoft C runtime."
4-
ms.date: "11/04/2016"
4+
ms.date: "09/29/2020"
55
ms.topic: "conceptual"
66
f1_keywords: ["_CRT_SECURE_NO_DEPRECATE", "_CRT_NONSTDC_NO_WARNINGS", "_CRT_SECURE_NO_WARNINGS"]
77
helpviewer_keywords: ["security deprecation warnings [C++]", "CRT_NONSTDC_NO_DEPRECATE", "buffers [C++], buffer overruns", "deprecation warnings (security-related), disabling", "_CRT_NONSTDC_NO_WARNINGS", "security [CRT]", "_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE", "_CRT_SECURE_NO_DEPRECATE", "security-enhanced CRT", "CRT_SECURE_NO_WARNINGS", "CRT_SECURE_NO_DEPRECATE", "deprecation warnings (security-related)", "buffer overruns", "CRT_NONSTDC_NO_WARNINGS", "CRT, security enhancements", "parameters [C++], validation"]
@@ -11,17 +11,17 @@ ms.assetid: d9568b08-9514-49cd-b3dc-2454ded195a3
1111

1212
Many old CRT functions have newer, more secure versions. If a secure function exists, the older, less secure version is marked as deprecated and the new version has the `_s` ("secure") suffix.
1313

14-
In this context, "deprecated" means that using the function's isn't recommended. It doesn't mean that the function is scheduled to be removed from the CRT.
14+
In this context, "deprecated" means using the function's isn't recommended. It doesn't mean the function is scheduled to be removed from the CRT.
1515

16-
The secure functions don't prevent or correct security errors. Instead, they catch errors when they occur. They perform additional checks for error conditions, and in the case of an error, they invoke an error handler (see [Parameter Validation](../c-runtime-library/parameter-validation.md)).
16+
The secure functions don't prevent or correct security errors. Instead, they catch errors when they occur. They do additional checks for error conditions. If there is an error, they invoke an error handler (see [Parameter Validation](../c-runtime-library/parameter-validation.md)).
1717

18-
For example, the `strcpy` function has no way of telling if the string that it's copying is too large for its destination buffer. However, its secure counterpart, `strcpy_s`, takes the size of the buffer as a parameter, so it can determine if a buffer overrun will occur. If you use `strcpy_s` to copy 11 characters into a 10 character buffer, that is an error on your part; `strcpy_s` cannot correct your mistake. But it can detect your error and inform you by invoking the invalid parameter handler.
18+
For example, the `strcpy` function can't tell if the string it's copying is too large for the destination buffer. Its secure counterpart, `strcpy_s`, takes the size of the buffer as a parameter. So it can determine if a buffer overrun will occur. If you use `strcpy_s` to copy 11 characters into a 10 character buffer, that is an error on your part; `strcpy_s` can't correct your mistake. But it can detect your error and inform you by invoking the invalid parameter handler.
1919

2020
## Eliminating deprecation warnings
2121

2222
There are several ways to eliminate deprecation warnings for the older, less secure functions. The simplest is simply to define `_CRT_SECURE_NO_WARNINGS` or use the [warning](../preprocessor/warning.md) pragma. Either will disable deprecation warnings, but the security issues that caused the warnings still exist. It's better to leave deprecation warnings enabled and take advantage of the new CRT security features.
2323

24-
In C++, the easiest way to do that is to use [Secure Template Overloads](../c-runtime-library/secure-template-overloads.md). This will eliminate deprecation warnings in many cases by replacing calls to deprecated functions with calls to the secure versions of those functions. For example, consider this deprecated call to `strcpy`:
24+
In C++, the easiest way to do that is to use [Secure Template Overloads](../c-runtime-library/secure-template-overloads.md). This will eliminate deprecation warnings, in many cases, by replacing calls to deprecated functions with calls to secure versions of those functions. For example, consider this deprecated call to `strcpy`:
2525

2626
```
2727
char szBuf[10];
@@ -36,7 +36,7 @@ Another source of deprecation warnings, unrelated to security, is the POSIX func
3636

3737
## Additional Security Features
3838

39-
Some of the security features include the following:
39+
Some of the security features include:
4040

4141
- `Parameter Validation`. Secure functions, and many of their unsecure counterparts, validate parameters. Validation may include:
4242

@@ -46,13 +46,13 @@ Some of the security features include the following:
4646

4747
- For more information, see [Parameter Validation](../c-runtime-library/parameter-validation.md).
4848

49-
- A handler for invalid parameters is also accessible to the developer. When an invalid parameter is encountered, instead of asserting and exiting the application, the CRT provides a way to check these problems via [_set_invalid_parameter_handler, _set_thread_local_invalid_parameter_handler](../c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler.md).
49+
- A handler for invalid parameters is also accessible to the developer. When a function encounters an invalid parameter, instead of asserting and exiting the application, the CRT allows you to check these problems via [_set_invalid_parameter_handler, _set_thread_local_invalid_parameter_handler](../c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler.md).
5050

51-
- `Sized Buffers`. Any secure function that writes to a buffer, require that you pass the buffer size. The secure versions validate that the buffer is large enough before writing to it, which helps avoid dangerous buffer overrun errors that could allow malicious code to execute. These functions usually return an `errno` error code and invoke the invalid parameter handler if the size of the buffer is too small. Functions that read from input buffers, such as `gets`, have secure versions that require you to specify a maximum size.
51+
- `Sized Buffers`. You must pass the buffer size to any secure function that writes to a buffer. The secure versions validate that the buffer is large enough before writing to it. Which helps avoid dangerous buffer overrun errors that could allow malicious code to execute. These functions usually return an `errno` error code and invoke the invalid parameter handler if the size of the buffer is too small. Functions that read from input buffers, such as `gets`, have secure versions that require you to specify a maximum size.
5252

5353
- `Null termination`. Some functions that left potentially non-terminated strings have secure versions, which ensure that strings are properly null-terminated.
5454

55-
- `Enhanced error reporting`. The secure functions return error codes with more error information than was available with the preexisting functions. The secure functions and many of the preexisting functions now set `errno` and often return an `errno` code type as well, to provide better error reporting.
55+
- `Enhanced error reporting`. The secure functions return error codes with more error information than was available with the pre-existing functions. The secure functions and many of the pre-existing functions now set `errno` and often return an `errno` code type as well, to provide better error reporting.
5656

5757
- `Filesystem security`. Secure file I/O APIs support secure file access in the default case.
5858

0 commit comments

Comments
 (0)