Date: 12/06/00
- Next message: Sascha Schumann: "Re: [PHP-DEV] zend_hash_add_or_update flaw"
- Previous message: Andre Felipe: "[PHP-DEV] Problem compiling PHP4.0.2 with Openlink ODBC"
- Next in thread: Sascha Schumann: "Re: [PHP-DEV] zend_hash_add_or_update flaw"
- Reply: Sascha Schumann: "Re: [PHP-DEV] zend_hash_add_or_update flaw"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I don't quite understand what flaw you are talking about.
pDataPtr is a void *. If the size of the data we are receiving is the same
size of pDataPtr (sizeof(void *)) we copy it's value to pDataPtr. I don't
see why doing it via a cast doesn't work. It should work on all platforms.
pDataPtr = *(void **)pData (where pData is the size of void *).
What your patch does isn't fixing a flaw (unless I'm missing something) but
adding functionality by using pDataPtr even if pData is smaller than void *.
If I'd know that on all systems memcpy() is as fast as doing it with a cast
I wouldn't mind the patch but I am pretty sure it isn't.
Andi
At 07:16 PM 12/6/00 +0100, Sascha Schumann wrote:
> Hi,
>
> the OnUpdateTags function exposed an apparent flaw in
> zend_hash_add_or_update(). The macro INIT_DATA assumes that a
> data element of the size sizeof(void *) is always a pointer
> to a pointer and tries to dereference it.
>
> The attached patch fixes that flaw and uses pDataPtr to
> generally speed up storage of small elements.
>
> Comments?
>
> - Sascha
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Sascha Schumann: "Re: [PHP-DEV] zend_hash_add_or_update flaw"
- Previous message: Andre Felipe: "[PHP-DEV] Problem compiling PHP4.0.2 with Openlink ODBC"
- Next in thread: Sascha Schumann: "Re: [PHP-DEV] zend_hash_add_or_update flaw"
- Reply: Sascha Schumann: "Re: [PHP-DEV] zend_hash_add_or_update flaw"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

