Re: Segfault in libpspell


Subject: Re: Segfault in libpspell
From: Kevin Atkinson (kevina@users.sourceforge.net)
Date: Wed Nov 15 2000 - 00:04:07 CST


On Tue, 14 Nov 2000, Sam TH wrote:

> On Tue, Nov 14, 2000 at 07:29:43PM -0500, Kevin Atkinson wrote:
> > On Tue, 14 Nov 2000, Matt Brubeck wrote:
> >
> > > Also, pspell_manager_check() should not segfault when passed a null
> > > pointer as its first argument. This is a bug in Pspell.
> >
> > Um, Why? You are violating an implied precondition of passing in a valid
> > pointer.
> >
>
> Because programs shouldn't segfault. This is certainly our fault,
> for passing the NULL pointer. However, it is preferable to check
> that, than to just segfault.

A library can certainly segfault. The behavior of many libc functions
are undefined if you give them invalid input. Similarly the behavior of
many pspell functions are undefined if you give them invalid input.

Just what would you like me to do if I get a null pointer?

---
Kevin Atkinson
kevina at users sourceforge net
http://metalab.unc.edu/kevina/



This archive was generated by hypermail 2b25 : Tue Nov 14 2000 - 23:54:19 CST