Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c Subject: Re: Testing if a pointer is valid Date: Mon, 19 Sep 2011 08:23:50 +1200 Lines: 15 Message-ID: <9dn2amFr5dU7@mid.individual.net> References: <485d26ed-8e0c-4ad2-92de-ac71961b75dd@17g2000yqv.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net nO25sHKl0tIjQN37pwY9/QqtmTlTXs+w2jtLjwkW6Hnc9ShqD0 Cancel-Lock: sha1:+ivaFRcQR/IZmbn011ryUaiPjFk= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:10444 On 09/19/11 08:00 AM, Kleuskes & Moos wrote: > On Sun, 18 Sep 2011 19:25:49 +0200, jacob navia wrote: > >> You should have a way to avoid crashes because of malicious code that >> feeds you a bad pointer isn't it? > > You should not be uncertain wether or not a pointer is valid or not. If > you are, your design stinks. If you try to compensate by adding checks, > your methodology stinks, too. That's untrue. How can a library designer know what a user will pass to one of their functions? -- Ian Collins