This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

found an overlapping data buffer in file natGCInfo.cc


Hello,

while checking the sources of gcc-4.4.1 with the static code analysis tool cppcheck i found an overlapping data buffer in file gcc-4.4.1/libjava/gnu/gcj/natGCInfo.cc at line 410. 

Take a look at the file:

static void *
nomem_handler(size_t size)
{
  if (oomDumpName)
    {
      char temp[strlen(oomDumpName) + 20];
410   sprintf(temp, "%s%03d", temp, GC_dump_count++);
      printf("nomem_handler(%zd) called\n", size);
      gc_ok--;
      GC_enumerator x(temp);
      x.enumerate();
      gc_ok++;
    }
  return (void*)0;
}

Indeed, the buffer overlapps. This can lead to segmentation faults!

Best regards

Ettl Martin

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]