# segv attempting to call sapi_module.treat_data()

- Thread: https://externals.io/message/17325
- Original archive: https://news-web.php.net/php.internals/17325
- Started by Wez Furlong on 2005-07-19T19:01:12+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

---

## #17325 — Wez Furlong — 2005-07-19T19:01:12+00:00

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

(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0127626f in php_hash_environment () at
/data/wez/php-HEAD/main/php_variables.c:648
#2  0x0126a2ce in php_request_startup () at /data/wez/php-HEAD/main/main.c:1064
#3  0x01310e01 in php_apache_request_ctor (r=0x8fc8200, ctx=0x8fc9a20)
at /data/wez/php-HEAD/sapi/apache2handler/sapi_apache2.c:438
#4  0x01311302 in php_handler (r=0x8fc8200) at
/data/wez/php-HEAD/sapi/apache2handler/sapi_apache2.c:527
#5  0x0021e9f7 in ap_run_handler () from /usr/sbin/httpd

php_hash_environment() is calling sapi_module.treat_data() without
first verifying that it is set to something sane, leading to the
crash.

I've committed a fix, simply checking if treat_data is `NULL` before
attempting to call it; this makes things work again for me.

--Wez.
