|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-01-12 16:34 UTC] bugreports at internot dot info
Description:
------------
Hi,
In /ext/standard/filters.c:
277 if (php_strip_tags_filter_ctor(inst, tags_ss.s->val, tags_ss.s->len, persistent) != SUCCESS) {
it should be "tags_ss->s", not "tags_ss.s"
it will cause a null pointer dereference.
Thanks,
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 19:00:02 2025 UTC |
Here is how tags_ss is defined: smart_str tags_ss = {0}; I don't think the compiler will agree to dereference a struct. Try to change and recompile it yourself.I don't understand what you mean. But it should be tags_ss->s, since.. this code: 265 smart_str_appendc(&tags_ss, '<'); does this: smart_str_appendc_ex((dest), (c), 0) which does this: 85static zend_always_inline void smart_str_appendc_ex(smart_str *dest, char ch, zend_bool persistent) { 86 size_t new_len = smart_str_alloc(dest, 1, persistent); 87 dest->s->val[new_len - 1] = ch; 88 dest->s->len = new_len; 89} (notice the dest->s->val, dest->s->len.) Thanks,Mmm. Ok, I get you. There's another problem, though: this code: 263 ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(filterparams), tmp) { 264 convert_to_string_ex(tmp); 265 smart_str_appendc(&tags_ss, '<'); 266 smart_str_append(&tags_ss, Z_STR_P(tmp)); 267 smart_str_appendc(&tags_ss, '>'); 268 } ZEND_HASH_FOREACH_END(); 269 smart_str_0(&tags_ss); ZEND_HASH_FOREACH_VAL is a macro for ZEND_HASH_FOREACH If this: (_idx = 0; _idx < (_ht)->nNumUsed; _idx++) is false(from the ZEND_HASH_FOREACH function), then tags_ss.s will be a null pointer.