From a4355d8d73b68bd2dde1be4b0c6ac61c628a74af Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Fri, 27 Oct 2006 21:15:26 +0000 Subject: Fri Oct 27 21:54:32 CEST 2006 VMiklos * alpm_parse_config(): add missing sanity checks From: http://darcs.frugalware.org/patches/pacman/20061027195432-e2957-0dcda6bdb2d7516d6a5047185bc14ccdf3fb83fc.patch --- lib/libalpm/alpm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index f0798316..0c5f28e7 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -1182,7 +1182,12 @@ int alpm_parse_config(char *file, alpm_cb_db_register callback, const char *this if(this_section != NULL && strlen(this_section) > 0) { strncpy(section, this_section, min(255, strlen(this_section))); - db = _alpm_db_register(section, callback); + if(!strcmp(section, "local")) { + RET_ERR(PM_ERR_CONF_LOCAL, -1); + } + if(strcmp(section, "options")) { + db = _alpm_db_register(section, callback); + } } while(fgets(line, PATH_MAX, fp)) { -- cgit v1.2.3-70-g09d2