summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorAllan McRae <mcrae_allan@hotmail.com>2007-12-22 16:57:43 +0100
committerDan McGee <dan@archlinux.org>2007-12-29 02:46:21 +0100
commit14d6832ef24aeda7fe77cf4285538baa6e21670c (patch)
tree5e2cb671385c34ede6281c70937c46f355071e14 /lib/libalpm/trans.c
parentcca4ec647e6b5e1959206348360cc7412a5e8ed2 (diff)
downloadpacman-14d6832ef24aeda7fe77cf4285538baa6e21670c.tar.gz
pacman-14d6832ef24aeda7fe77cf4285538baa6e21670c.tar.xz
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 <mcrae_allan@hotmail.com> [Dan: fix whitespace] Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c4
1 files changed, 3 insertions, 1 deletions
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;