On a related note, placing null-bytes in the middle of strings (for example
in the names of the so-called lambda_functions generated from
create_function()) seems like a pretty questionable practice.

----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, August 02, 2001 12:18 PM
Subject: Re: [PHP-DEV] Programming question


> > can it be assumed that
> > zval.str.val[zval.str.len] = '\0'?
> >
> > i.e., the byte after the string in a zval is the null-byte?
> >
> > That is assumed in various places in ext/standard/string.c, and AFAIK
> > that may not always be true.
>
> No code in PHP should assume this.  PHP should always check the length.
> However, many external libraries that take string arguments are not going
> to be able to check our length property and we therefore should strive to
> null-terminate all strings.  I noticed Thies has been going through
> recently and cleaning this up a bit.
>
> -Rasmus
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to