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,a0833bbed8752e1f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!proxad.net!freenix!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Sender: obry@PASCAL Newsgroups: comp.lang.ada Subject: Re: variable lenght strings References: <1861614.TWv5A9FgVL@linux1.krischik.com> <4178e979_1@baen1673807.greenlnk.net> <1195374.UMjBCk7lO1@linux1.krischik.com> <1154613.ipZcUgduzp@linux1.krischik.com> <1174011.lJ1dcgRM3Q@linux1.krischik.com> <1098814048.280053@master.nyc.kbcfp.com> From: Pascal Obry Organization: Home - http://perso.wanadoo.fr/pascal.obry User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Date: 26 Oct 2004 22:10:28 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: AVelizy-151-2-6-17.w82-120.abo.wanadoo.fr X-Trace: 1098821432 news.wanadoo.fr 3211 82.120.26.17:3874 X-Complaints-To: abuse@wanadoo.fr Xref: g2news1.google.com comp.lang.ada:5735 Date: 2004-10-26T22:10:28+02:00 List-Id: Hyman Rosen writes: > Pascal Obry wrote: > > This kind of recursivity is very dangerous and could cause a stack > > overflow. > > Why is it dangerous? Won't Ada just raise a memory exception? Because the object is on the stack. This is not a problem of memory but of stack space. A program using too much stack will likely got out of stack space and receive a Program_Error exception. There is no much you can do at this point, in many cases the only solution is to exit-as-soon-as-possible! Such program is creating a security hole anyway... if you know that somebody has used such algorithm just send him (file upload on a Web site for example) a file with a very long line! Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.org --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595