diff --git a/ChangeLog b/ChangeLog index b4aff9ba0..eb725d4de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Aug 21 21:42:14 CEST 2007 (tk) +---------------------------------- + * libclamav/rtf.c: fix possible NULL dereference (bb#611) + Tue Aug 21 21:39:06 CEST 2007 (tk) ---------------------------------- * libclamav/ole2_extract.c: properly initialise hdr.max_block_no (bb#603) diff --git a/libclamav/rtf.c b/libclamav/rtf.c index 33c24eae2..e5a0f77ad 100644 --- a/libclamav/rtf.c +++ b/libclamav/rtf.c @@ -606,7 +606,9 @@ int cli_scanrtf(int desc, cli_ctx *ctx) return ret; } if(( ret = state.cb_process(&state, ptr, use) )) { - state.cb_end(&state,ctx); + if(state.cb_end) { + state.cb_end(&state,ctx); + } SCAN_CLEANUP; return ret; } @@ -677,6 +679,7 @@ int cli_scanrtf(int desc, cli_ctx *ctx) if(action != -1) { if(state.cb_data && state.cb_end) {/* premature end of previous block */ state.cb_end(&state,ctx); + state.cb_begin = NULL; state.cb_end = NULL; state.cb_data = NULL; }