From 96f7613d15e46131bf8a4b93828ad70b041524d1 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 24 Feb 2008 01:17:17 -0600 Subject: Add some NULL checks into recently modified output functions After a merge with master where some strings we print (such as descriptions) could be NULL, a few segfaults popped up due to strlen() calls on null pointers. Fix this by doing some preemptive checks and returning from functions early if the string was null. Signed-off-by: Dan McGee --- src/pacman/callback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pacman/callback.c') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 629c2e1c..01e65a95 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -592,7 +592,7 @@ void cb_dl_progress(const char *filename, int file_xfered, int file_total, /* Callback to handle notifications from the library */ void cb_log(pmloglevel_t level, char *fmt, va_list args) { - if(strlen(fmt) == 0) { + if(!fmt || strlen(fmt) == 0) { return; } -- cgit v1.2.3-24-g4f1b