[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: does lua_pushstring check stack overflow? (Lua 5.0.2)
- From: Glenn Maynard <glenn@...>
- Date: Tue, 29 Nov 2005 11:23:40 -0500
On Tue, Nov 29, 2005 at 10:21:54AM +0100, Klaus Ripke wrote:
> The point which you obviously missed is that it's not by chance
> you came up with a bad example which is not a library function.
> Let's see ... sprintf? Hmm ... memcpy? ... no. You're on your own.
> The C language does define a lot of library functions and none
> checks bad pointers. So yes, it is a matter of the language.
Try calling Win32 CreateDialog() with an invalid window template name, or
vorbisfile's ov_read() on a file that failed to open. You'll get errors,
not crashes. Nothing about the fact that a library is written in C implies
that it shouldn't sanity check its parameters or internal state.
I'm dropping the discussion here. You turn a simple three-line statement
into two pages of arguments, and although I find all of the arguments to be
wrong on their face, it's not a good use of time for me to spend half an
hour responding to them all. If anyone finds them convincing, so be it.
My intent was to prevent Luiz's "you're always on your own" statement from
setting root in the minds of innocently lurking readers (who may be
impressionable novices), and I've accomplished that goal well enough.