Skip to content

Commit 8ec8ffa

Browse files
Update docs/code-quality/c26832.md
Co-authored-by: dmitrykobets-msft <89153909+dmitrykobets-msft@users.noreply.github.com>
1 parent 1f7db31 commit 8ec8ffa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/code-quality/c26832.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void foo(unsigned short i, unsigned short j)
2727
2828
In `i + j`, `i` and `j` are promoted to integers and the result of the addition is stored into a temporary integer. This integer is implicitly casted to `unsigned short` before the value is stored to `size`. The result of this cast might overflow. So, `SmallAlloc` might end up returning a buffer smaller than expected. Future accesses like `p[i]` are out of bounds. These code patterns can result in remote code execution vulnerabilities.
2929
30-
Common allocation functions like `new`, `malloc`, and `VirtalAlloc` are recognized. The check also tries to recognize custom allocator functions by case insensitive search for the `alloc` substring in the function name.
30+
Common allocation functions like `new`, `malloc`, and `VirtualAlloc` are recognized. The check also tries to recognize custom allocator functions by case insensitive search for the `alloc` substring in the function name.
3131
3232
Our analysis engine's numerical solver have some limitations reasoning about numerical overflows. As a result, this check is using some heuristics and sometimes fails to recognize that certain checks can prevent overflows.
3333
Usually, checking for a reasonable bound on the allocation should work.

0 commit comments

Comments
 (0)