From ccd3a3eb9fad7b4c311a6bfb57b69a7a1a13c46a Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Thu, 16 Jul 2015 19:05:32 -0400 Subject: check assumeinstalled for meaningful mod assumeinstalled options are used as provisions for which MOD_EQ and MOD_ANY are the only meaningful settings. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/handle.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 94452b00..a6a5861f 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -592,6 +592,8 @@ int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char * int SYMEXPORT alpm_option_add_assumeinstalled(alpm_handle_t *handle, const alpm_depend_t *dep) { CHECK_HANDLE(handle, return -1); + ASSERT(dep->mod == ALPM_DEP_MOD_EQ || dep->mod == ALPM_DEP_MOD_ANY, + RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); handle->assumeinstalled = alpm_list_add(handle->assumeinstalled, (void *)dep); return 0; -- cgit v1.2.3-70-g09d2