Skip to content

Commit

Permalink
Merge pull request #1 from phonpeng/master
Browse files Browse the repository at this point in the history
Support tracing dim concat result 
thanks for phonpeng
  • Loading branch information
laruence committed Nov 5, 2012
2 parents c38f3e1 + 0b5eebc commit 5551ecb
Show file tree
Hide file tree
Showing 4 changed files with 789 additions and 84 deletions.
15 changes: 14 additions & 1 deletion php_taint.h
Expand Up @@ -34,7 +34,7 @@ extern zend_module_entry taint_module_entry;
#include "TSRM.h"
#endif

#define PHP_TAINT_VERSION "1.1.1-dev"
#define PHP_TAINT_VERSION "1.1.0"

#define PHP_TAINT_MAGIC_LENGTH sizeof(unsigned)
#define PHP_TAINT_MAGIC_NONE 0x00000000
Expand Down Expand Up @@ -93,13 +93,26 @@ extern zend_module_entry taint_module_entry;
#define TAINT_PZVAL_UNLOCK_FREE(z) taint_pzval_unlock_free_func(z)
#define TAINT_CV_OF(i) (EG(current_execute_data)->CVs[i])
#define TAINT_CV_DEF_OF(i) (EG(active_op_array)->vars[i])
#define TAINT_TMP_FREE(z) (zval*)(((zend_uintptr_t)(z)) | 1L)
#define TAINT_AI_USE_PTR(ai) \
if ((ai).ptr_ptr) { \
(ai).ptr = *((ai).ptr_ptr); \
(ai).ptr_ptr = &((ai).ptr); \
} else { \
(ai).ptr = NULL; \
}
#define TAINT_FREE_OP(should_free) \
if (should_free.var) { \
if ((zend_uintptr_t)should_free.var & 1L) { \
zval_dtor((zval*)((zend_uintptr_t)should_free.var & ~1L)); \
} else { \
zval_ptr_dtor(&should_free.var); \
} \
}
#define TAINT_FREE_OP_VAR_PTR(should_free) \
if (should_free.var) { \
zval_ptr_dtor(&should_free.var); \
}

#define PHP_TAINT_MARK(zv, mark) *((unsigned *)(Z_STRVAL_P(zv) + Z_STRLEN_P(zv) + 1)) = (mark)
#define PHP_TAINT_POSSIBLE(zv) (*(unsigned *)(Z_STRVAL_P(zv) + Z_STRLEN_P(zv) + 1) == PHP_TAINT_MAGIC_POSSIBLE)
Expand Down

0 comments on commit 5551ecb

Please sign in to comment.