gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

Left OOB accesses on new[]-allocated arrays with array cookies are not detected #314

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Left OOB accesses on new[]-allocated arrays with array cookies are not detected

Repro:
----------------------
struct C { 
  int x;
  ~C() {}
};

int main() {
  C *buffer = new C[42];
  buffer[-2].x = 42; 
  delete [] buffer;
}
----------------------
-> No report AND it hangs!

[-2] is not detected on Linux x64;
[-3] is detected.

Original issue reported on code.google.com by timurrrr@google.com on 22 May 2014 at 1:18

GoogleCodeExporter commented 9 years ago
Sorry, the repro was meant to have an access at [-1]

Original comment by timurrrr@google.com on 22 May 2014 at 1:18

GoogleCodeExporter commented 9 years ago

Original comment by konstant...@gmail.com on 22 May 2014 at 1:51

GoogleCodeExporter commented 9 years ago
Most of the work is in the FE: http://llvm.org/bugs/show_bug.cgi?id=19838

Original comment by konstant...@gmail.com on 23 May 2014 at 12:59

GoogleCodeExporter commented 9 years ago
also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61293

Original comment by konstant...@gmail.com on 23 May 2014 at 1:08