# [PATCH] MAX_LENGTH_OF_LONG, and possible buffer overflows

- Thread: https://externals.io/message/25195
- Original archive: https://news-web.php.net/php.internals/25195
- Started by Matt W on 2006-08-04T08:58:39+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #25195 — Matt W — 2006-08-04T08:58:39+00:00

URL: https://externals.io/message/25195#25195

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
