Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 1997 09:55:22 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, guido@gvr.win.tue.nl
Cc:        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:  <199703172255.JAA32577@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> >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.

>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).

Bruce



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