Skip to content

Commit dc0bd70

Browse files
Merge pull request #4446 from MugBergerFries/patch-7
Updated C6277
2 parents 3aef369 + 7a5698c commit dc0bd70

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

docs/code-quality/c6277.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
---
22
description: "Learn more about: C6277"
33
title: C6277
4-
ms.date: 11/04/2016
4+
ms.date: 09/28/2022
55
ms.topic: reference
6-
f1_keywords: ["C6277"]
6+
f1_keywords: ["C6277", "CREATEPROCESS_ESCAPE", "__WARNING_CREATEPROCESS_ESCAPE"]
77
helpviewer_keywords: ["C6277"]
88
ms.assetid: 2b41252a-68c2-4e92-b005-0458db5f4430
99
---
10-
# C6277
10+
# Warning C6277
1111

12-
> warning C6277: NULL application name with an unquoted path in call to \<function>: results in a security vulnerability if the path contains spaces
12+
> NULL application name with an unquoted path in call to '*function-name*': results in a security vulnerability if the path contains spaces
1313
14-
This warning indicates that the application name parameter is null and there might be spaces in the executable path name. In this case, unless the executable name is "fully qualified," there is likely to be a security problem. A malicious user might insert a rogue executable with the same name earlier in the path. To correct this warning, you can specify the application name instead of passing null or if you do pass null for the application name, use quotation marks around the executable path.
14+
This warning indicates that the application name parameter is null and that there might be spaces in the executable path name.
15+
16+
## Remarks
17+
18+
Unless the executable name is fully qualified, there's likely to be a security problem. A malicious user could insert a rogue executable with the same name earlier in the path. To correct this warning, you can specify the application name instead of passing null. Alternatively, if you do pass null for the application name, use quotation marks around the executable path.
19+
20+
Code analysis name: CREATEPROCESS_ESCAPE
1521

1622
## Example
1723

18-
The following sample code generates this warning because the application name parameter is null, and the executable path name has a space in it; there is a risk that a different executable could be run because of the way the function parses spaces. For more information, see [CreateProcess](/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa).
24+
The following sample code generates warning C6277. The warning is caused by the NULL application name and from the executable path name having a space. Due to how the function parses spaces, there's a risk that a different executable could be run. For more information, see [`CreateProcessA`](/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa).
1925

2026
```cpp
2127
#include <windows.h>

0 commit comments

Comments
 (0)