public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/40479]  New: libjava/gnu/gcj/util/natGCInfo.cc: bad call to sprintf
@ 2009-06-17 17:52 dcb314 at hotmail dot com
  2009-06-17 18:00 ` [Bug libgcj/40479] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: dcb314 at hotmail dot com @ 2009-06-17 17:52 UTC (permalink / raw)
  To: java-prs

I just had a look at the source file libjava/gnu/gcj/util/natGCInfo.cc
Around line 410 is the source code

      sprintf(temp, "%s%03d", temp, GC_dump_count++);

It cannot be correct to read and write from the same buffer
at the same time. Suggest replace one use of temp with another
variable.


-- 
           Summary: libjava/gnu/gcj/util/natGCInfo.cc: bad call to sprintf
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
  GCC host triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40479


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libgcj/40479] libjava/gnu/gcj/util/natGCInfo.cc: bad call to sprintf
  2009-06-17 17:52 [Bug java/40479] New: libjava/gnu/gcj/util/natGCInfo.cc: bad call to sprintf dcb314 at hotmail dot com
@ 2009-06-17 18:00 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-06-17 18:00 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-06-17 18:00 -------
      char temp[strlen(oomDumpName) + 20];
      sprintf(temp, "%s%03d", temp, GC_dump_count++);


I think it should rather be:

      sprintf(temp, "%s%03d", oomDumpName, GC_dump_count++);


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|java                        |libgcj
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-06-17 18:00:41
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40479


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-17 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 17:52 [Bug java/40479] New: libjava/gnu/gcj/util/natGCInfo.cc: bad call to sprintf dcb314 at hotmail dot com
2009-06-17 18:00 ` [Bug libgcj/40479] " pinskia at gcc dot gnu dot org

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).