Date: Tue, 18 Mar 1997 09:11:41 +0100 (MET) From: Guido van Rooij <guido@gvr.win.tue.nl> To: bde@zeta.org.au (Bruce Evans) Cc: bde@zeta.org.au, cvs-all@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-lib@freefall.freebsd.org, eivind@freefall.freebsd.org Subject: Re: cvs commit: src/lib/libtermcap tgoto.c Message-ID: <199703180811.JAA18631@gvr.win.tue.nl> In-Reply-To: <199703172255.JAA32577@godzilla.zeta.org.au> from Bruce Evans at "Mar 18, 97 09:55:22 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote: > >> >I think the if statements should be something like: > >> >if (dp >= &result[MAXRETURNSIZE-1]) > >> > >> This would ensure space for the terminator, but the check at the end > >> already does that. > > > >What check? I don;t see any check. According to me, the complete buffer > > The one before the final `return ("OVERFLOW");', of course. > Argh. I was looking at the wrong place. > >can now be filled with non-NUL bytes and afterwards even extended by > >sizeof(added). If added is "", then still the NUL would be one off. > > It can be filled with non-NUL bytes, in which case the check will fail > (modulo the bug in the check that dp+strlen(added)+1 is invalid if dp > is at the end). > Okay. I thik we're in sync now ;-) -Guido
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703180811.JAA18631>