[PATCH] MAX_LENGTH_OF_LONG, and possible buffer overflows

From: Date: Fri, 04 Aug 2006 08:58:39 +0000
Subject: [PATCH] MAX_LENGTH_OF_LONG, and possible buffer overflows
Groups: php.internals 
Request: Send a blank email to internals+get-25195@lists.php.net to get a copy of this message
Hi there, OK, so overflows aren't very likely with MAX_LENGTH_OF_LONG set to 20, but I found 3 places I think you'll want to change. :-) Also, can MAX_LENGTH_OF_LONG be changed to be accurate on 32-bit platforms? Is setting it to (sizeof(long) > 4 ? 20 : 11) acceptable? If MAX_LENGTH_OF_LONG is truely accurate, I can use it to optimize is_numeric_[string|unicode]() (and zend_u_strtod() too I think if it's not otherwise rewritten), and it saves a few bytes of memory on 32-bit systems. ;-) http://realplain.com/php/MAX_LENGTH_OF_LONG.diff http://realplain.com/php/MAX_LENGTH_OF_LONG_5_2.diff Thanks, Matt

« previous php.internals (#25195) next »