Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Dec 1998 01:08:54 -0800
From:      Mike Smith <mike@smith.net.au>
To:        sthaug@nethelp.no
Cc:        mike@smith.net.au, dcs@newsguy.com, current@FreeBSD.ORG
Subject:   Re: BootFORTH - demo floppy 
Message-ID:  <199812210908.BAA51022@dingo.cdrom.com>
In-Reply-To: Your message of "Mon, 21 Dec 1998 10:06:28 %2B0100." <13401.914231188@verdi.nethelp.no> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > We don't like counted strings.  They suck for innumerable reasons, and 
> > > > if the only reason for having them there is "tradition" (ie. there is 
> > > > no reason *not* to take them away) then they can damn well die.  8)
> > > 
> > > Given the many buffer overflows that have been found in various Unix
> > > applications through the years, and the recent cleanup of string handling
> > > in the kernel, maybe this view should be reexamined?
> > 
> > *groan*
> > 
> > Counted strings aren't somehow magically immune to overflowing their 
> > buffers.  Lousy programming technique will take you from behind no 
> > matter what technology you think you're using.
> 
> Of course. But counted strings can make some buffer overflow issues
> more visible, and may get the programmer to *think* about this.
> 
> As an example, qmail uses a library which reimplements a good bit of
> the string handling in stdio, using counted strings.
> 
> If counted strings suck for innumerable reasons, are these reasons
> documented somewhere?

Commonsense suggests the two major problems:

 - the count is usually too small (in the ANS Forth case, it's one byte)
 - the overhead for maintaining the count and working with it is
   often unconsionably high, ie. the tradeoffs aren't actually very 
   good.

This is something you usually learn when you try to do something useful 
with Pascal as a junior weenie.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812210908.BAA51022>