From 8df77884f38e7a7334b56aafe2f441567f175af8 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Wed, 29 Nov 2017 11:06:50 +0100 Subject: Fix segfault in sp_disabled_functions.c There was an off-by-one in `should_disable`, effectively smashing the last byte of the stack canary. This was discovered while building the package for Alpine Linux. Kudos to their hardened toolchain!--- src/sp_disabled_functions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c index 0b1cc91..44a215c 100644 --- a/src/sp_disabled_functions.c +++ b/src/sp_disabled_functions.c @@ -102,7 +102,7 @@ static bool is_local_var_matching(zend_execute_data *execute_data, const sp_disa } bool should_disable(zend_execute_data* execute_data) { - char current_file_hash[SHA256_SIZE * 2] = {0}; + char current_file_hash[SHA256_SIZE * 2 + 1] = {0}; const char* current_filename = zend_get_executed_filename(TSRMLS_C); const sp_node_t* config = SNUFFLEUPAGUS_G(config).config_disabled_functions->disabled_functions; -- cgit v1.3