Bug #2033: serialize() produces: FATAL: emalloc(): Unable to allocate 4160742841l bytes
| From: | elfchief at lupine dot org | Date: | Wed, 11 Aug 1999 18:13:08 +0000 |
| Subject: | Bug #2033: serialize() produces: FATAL: emalloc(): Unable to allocate 4160742841l bytes | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-9755@lists.php.net to get a copy of this message | ||
From: elfchief@lupine.org
Operating system: SunOS 4.1.3
PHP version: 3.0.12
PHP Bug Type: Misbehaving function
Bug description: serialize() produces: FATAL: emalloc(): Unable to allocate 4160742841l bytes
Calling serialize() produces an "unable to allocate insane amounts of memory" error...
Even <? serialize(5); ?> will produce this error.
This is caused because functions/var.c is using sprintf() rather than _php3_sprintf(), where the
latter is designed to work around a 'feature' in SunOS where sprintf returns the string
written (char *) rather than the number of characters written (int).
1,$ s/sprintf/_php3_sprintf/g in functions/var.c to repair this problem.
(I also noticed the same problem in interbase.c, though I don't use that module myself. The fix
is left as an exercise for the reader :)