public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: gdr@nerim.net
To: gcc-gnats@gcc.gnu.org
Cc: jkanze@caicheuvreux.com, gdr@nerim.net
Subject: libstdc++/8230: Buggy allocator behaviour
Date: Tue, 15 Oct 2002 05:56:00 -0000	[thread overview]
Message-ID: <20021015124809.5456.qmail@sources.redhat.com> (raw)


>Number:         8230
>Category:       libstdc++
>Synopsis:       Buggy allocator behaviour
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 15 05:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     James Kanze
>Release:        all GCC releases.
>Organization:
>Environment:
Plateform independent, though the program below
displays the buggy behaviour on IA32.
>Description:
std:allocator<T>::allocate(n) does not check for possible 
overflow before "folding" sizeof(T) * n.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="jk.C"
Content-Disposition: inline; filename="jk.C"

#include <vector>
#include <iostream>

int main()
{
   static size_t const size = 1024 * 1024 * 1024 ;
   std::vector< int >  array ;
   try {
      array.reserve( size ) ;
   } catch ( std::exception const& error ) {
      std::cerr << "Error: " << error.what() << " (type = " <<
         typeid( error ).name() << ")\n" ;
      return 2 ;
   }
   return 0 ;
}


             reply	other threads:[~2002-10-15 12:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15  5:56 gdr [this message]
2002-11-20  5:07 bkoz
2002-11-20 18:02 Gabriel Dos Reis
2002-11-20 18:19 Benjamin Kosnik
2002-11-20 18:20 Benjamin Kosnik
2002-11-20 19:09 Gabriel Dos Reis
2002-11-20 23:03 Gabriel Dos Reis
2002-11-21  3:47 Matt Austern
2002-11-21  4:06 Gabriel Dos Reis
2002-11-21 14:01 Richard Henderson
2002-11-23  1:16 bkoz

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=20021015124809.5456.qmail@sources.redhat.com \
    --to=gdr@nerim.net \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=jkanze@caicheuvreux.com \
    /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).