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,839916f6ca3b6404 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!40g2000prx.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: not null Date: Thu, 5 Mar 2009 08:07:40 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <49ae93bc$0$31872$9b4e6d93@newsspool3.arcor-online.net> <49ae9cc4$0$31877$9b4e6d93@newsspool3.arcor-online.net> <49afe0a7$0$31878$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1236269260 4814 127.0.0.1 (5 Mar 2009 16:07:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 5 Mar 2009 16:07:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 40g2000prx.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3972 Date: 2009-03-05T08:07:40-08:00 List-Id: On Mar 5, 6:24 am, Georg Bauhaus wrote: > Adam Beneschan schrieb: > > > > > On Mar 4, 7:22 am, Georg Bauhaus > > wrote: > > >> The overall impact of refs not "attached" (to use > >> an Eiffel term; not null is spreading through languages > >> it seems; C++, too?) is a financial disaster, with > >> possibly one exception: there is money in a business > >> selling software components whose purpose is to guard > >> the holes kept open by operating system sellers. > > >> (Antivirus etc.) > > > Is there any basis for this last comment? I've seen lots of reports > > of vulnerabilities caused by buffer overflows combined with lack of > > range checking, and by double-deallocation errors (deallocating the > > same chunk of memory twice and making hash of your heap structures), > > but I don't recall seeing any caused by null references. Errors > > involving null references seem a lot more likely just to make programs > > die unexpectedly, than to allow arbitrary code execution or the like. > > You have caught me in an argument over CeBIT discussions > concerning the security of OSs and server software, > so I might have been carried away. > > OTOH, the very presence of null values seems close > to the causes of buffer overflow, of accessing/overwriting > data off bounds, etc. This is simply because NULL > (similarly, '\0') is thought of as a regular thing, > for the programmer to handle routinely with any > sequential piece of data. On most systems, though, if you try to handle NULL as just with any other pointer, and dereference it, your program will immediately crash and burn on an invalid memory reference fault. Yes, I realize this isn't the case on all platforms. Plus, in C, where pointer arithmetic is common, you can add something to NULL and try to dereference that, causing serious problems. So there do seem to be ways that bad use of a null pointer could cause a program to behave in a way that would allow a virus to get installed. I just think it's a lot less common. -- Adam