From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f2690a5e963b61b6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 07 Jul 2005 14:15:19 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1120474891.635131.216700@g44g2000cwa.googlegroups.com> <1120575076.876798.108220@g44g2000cwa.googlegroups.com> <1120583470.429264.325450@g43g2000cwa.googlegroups.com> <1120586558.930583.79880@g49g2000cwa.googlegroups.com> <1120590526.790939.236390@g49g2000cwa.googlegroups.com> <1120591595.158965.50780@g44g2000cwa.googlegroups.com> <1120592684.622723.174350@g44g2000cwa.googlegroups.com> <1120593983.215972.308010@g14g2000cwa.googlegroups.com> <1120615856.997416.158870@g14g2000cwa.googlegroups.com> <1120707674.230510.280700@g47g2000cwa.googlegroups.com> Subject: Re: GCC 4.0 Ada.Containers Cursor danger. Date: Thu, 7 Jul 2005 14:18:28 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-6Ss/cJtCDLesUHp7DwdKLV7QzWFeVh+pOAxp7shc4oGBl+HyGRfYvybyV/bXXAVc1SjqfOGZ1KX+sM8!50+mY6yacHhJBVis+2SO2JA6PGwGLZy53HY6nN8cQ1NgURDCFjP4n/V6Z+uUR6c4ZZVBcJBJ0nhi X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:11946 Date: 2005-07-07T14:18:28-05:00 List-Id: "Dmitriy Anisimkov" wrote in message news:1120707674.230510.280700@g47g2000cwa.googlegroups.com... > < address clauses, Unchecked_Conversion, pragma Suppress, >> > > The danger of this operations is undersood, at least for me. > > <> > > I do not know how the streams and IO could broke memory. Could you > explain a bit more ? Input of binary data is essentially the same operation as an Unchecked_Conversion from an array of byte to the output object. If the output object is composite, what is read in can make the object "abnormal"; any use of an abnormal object afterwards causes erroneous execution and thus may corrupt memory. Most problems happen if an object with embedded pointers (explicit or implicit) is read, because it is never safe to read in pointers. (The memory that they point at is unlikely to contain the same objects.) But (almost) any binary input can cause problems if the stream of bytes is corrupted. And the program really has no control over that, as anything can happen to the file after it is written and before it is read. Randy.