DynamoRIO / DynamoRIO/drmemory

Crash in distinguish_operator_type

Open
#1,650 0 comments 0 reactions 0 assignees View on GitHub
Migrated Priority-Medium
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [skochin...@gmail.com](https://code.google.com/u/109057279813387914920/) on October 29, 2014 09:55:24_

In one code flow, the func_type->arg_types[1] element is accessed without checking the number of arguments first. This causes a crash when running drmemory on our application. I haven't tracked to the exact symbol causing it, but adding the check fixes it:

--- common/alloc.c ( revision 2103 )
+++ common/alloc.c (working copy)
@@ -1884,7 +1884,7 @@
WARN("WARNING: unknown 2-arg overload of %s in %s @"PFX"\n",
name, modname, mod->start + info->start_offs);
}
- } else {
- } else if (func_type->num_args > 2) {
/\* MSVC++ has 3-arg and 4-arg operators which we assume
\* are all non-placement non-nothrow:
\* operator new(unsigned int, _HeapManager*, int)

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=1650_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.