From ef3f7139ec86030a64ce4fed4976c0424fbc0637 Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Fri, 21 Oct 2011 10:45:14 +0000 Subject: fixed a bug when some application using hooked functions before hook library is initialized --- src/hook_lib/file_hook.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hook_lib/file_hook.c b/src/hook_lib/file_hook.c index 5630581..728ab4e 100644 --- a/src/hook_lib/file_hook.c +++ b/src/hook_lib/file_hook.c @@ -237,6 +237,9 @@ void _fini() { * Format of log string: time event filename stage result/err */ static int __raw_log_event(const char *event_type, const char *filename, char *result,int err, char* stage) { + if(! is_initialized) // it is essential to initialize hooks because we are + __init_hooks(); // using _snprintf here + char msg_buff[MAXSOCKETMSGLEN]; int bytes_to_send; if(strcmp(result,"ERR")==0) { -- cgit v1.2.3-65-gdbad