public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Ettl" <ettl.martin@gmx.de>
To: java@gcc.gnu.org
Subject: found an overlapping data buffer in file natGCInfo.cc
Date: Mon, 27 Jul 2009 08:29:00 -0000	[thread overview]
Message-ID: <20090727082913.78960@gmx.net> (raw)

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

             reply	other threads:[~2009-07-27  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27  8:29 Martin Ettl [this message]
2009-07-27 10:03 ` Andrew Haley
2009-07-27 14:43   ` David Daney
2009-07-27 17:01     ` Andrew Haley
2009-07-27 19:09       ` Martin Ettl
2009-07-28  8:08         ` Andrew Haley
2009-07-28 14:17           ` Martin Ettl
2009-07-29  7:11             ` Andrew Haley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090727082913.78960@gmx.net \
    --to=ettl.martin@gmx.de \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).