From 14d6832ef24aeda7fe77cf4285538baa6e21670c Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 23 Dec 2007 01:57:43 +1000 Subject: Allow NULL parameter in alpm_trans_commit Fixes FS#7380: alpm crashes on passing NULL to alpm_trans_commit in a sync operation. Adds check that data parameter is not NULL in several functions. Signed-off-by: Allan McRae [Dan: fix whitespace] Signed-off-by: Dan McGee --- lib/libalpm/trans.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 582c76b7..292c7160 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -342,7 +342,9 @@ int _alpm_trans_addtarget(pmtrans_t *trans, char *target) int _alpm_trans_prepare(pmtrans_t *trans, alpm_list_t **data) { - *data = NULL; + if(data) { + *data = NULL; + } ALPM_LOG_FUNC; -- cgit v1.2.3-24-g4f1b