From: Chris B. <buc...@us...> - 2011-06-21 22:55:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via f2c648124cdde58f6b25810d00be7745bf4d91ad (commit) from 5129f32304b98fcd05d66fb21be04f7d5da20359 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f2c648124cdde58f6b25810d00be7745bf4d91ad Author: buccella <buc...@li...> Date: Tue Jun 21 18:55:30 2011 -0400 [ 3324265 ] _sfcb_trace may deref NULL pointers ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index b7d4125..7976eea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-06-21 Chris Buccella <buc...@li...> + * trace.c: + [ 3324265 ] _sfcb_trace may deref NULL pointers + * support.c: [ 3324255 ] Unnecessary NULL check in __cleanup_mt() diff --git a/NEWS b/NEWS index e38a379..07821af 100644 --- a/NEWS +++ b/NEWS @@ -98,6 +98,7 @@ Bugs Fixed: - 3324198 getObjectPath() may deref a NULL pointer - 3324247 Unnecessary NULL check in providerDrv - 3324255 Unnecessary NULL check in __cleanup_mt() +- 3324265 _sfcb_trace may deref NULL pointers Changes in 1.3.11 ================= diff --git a/trace.c b/trace.c index 9276638..55aaae6 100644 --- a/trace.c +++ b/trace.c @@ -155,6 +155,7 @@ _sfcb_format_trace(char *fmt, ...) void _sfcb_trace(int level, char *file, int line, char *msg) { + if (msg == NULL) return; struct tm cttm; struct timeval tv; @@ -181,26 +182,26 @@ _sfcb_trace(int level, char *file, int line, char *msg) if (gmtime_r(&sec, &cttm) != NULL) { strftime(tm, 20, "%m/%d/%Y %H:%M:%S", &cttm); } - } - if (colorTrace) { - changeTextColor(0); - fprintf(ferr, "[%i] [%s] %d/%p --- %s(%i) : %s\n", level, tm, - currentProc, (void *) pthread_self(), file, line, msg); - changeTextColor(1); - } else { - fprintf(ferr, "[%i] [%s] %d/%p --- %s(%i) : %s\n", level, tm, - currentProc, (void *) pthread_self(), file, line, msg); + if (colorTrace) { + changeTextColor(0); + fprintf(ferr, "[%i] [%s] %d/%p --- %s(%i) : %s\n", level, tm, + currentProc, (void *) pthread_self(), file, line, msg); + changeTextColor(1); + } else { + fprintf(ferr, "[%i] [%s] %d/%p --- %s(%i) : %s\n", level, tm, + currentProc, (void *) pthread_self(), file, line, msg); + } + + free(tm); + free(msg); + } if ((_SFCB_TRACE_FILE != NULL)) { fclose(ferr); } - if (tm) - free(tm); - if (msg) - free(msg); } extern void hooks/post-receive -- SFCB - Small Footprint CIM Broker |