summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-10-27 23:15:26 +0200
committerAaron Griffin <aaron@archlinux.org>2006-10-27 23:15:26 +0200
commita4355d8d73b68bd2dde1be4b0c6ac61c628a74af (patch)
treef62bb19f65efc743a545c08d40d2e4b328d95c77 /lib
parent3e5401b74de0bc19f6eac48dd45c656a5c4e5ed7 (diff)
downloadpacman-a4355d8d73b68bd2dde1be4b0c6ac61c628a74af.tar.gz
pacman-a4355d8d73b68bd2dde1be4b0c6ac61c628a74af.tar.xz
Fri Oct 27 21:54:32 CEST 2006 VMiklos <vmiklos@frugalware.org>
* alpm_parse_config(): add missing sanity checks From: http://darcs.frugalware.org/patches/pacman/20061027195432-e2957-0dcda6bdb2d7516d6a5047185bc14ccdf3fb83fc.patch
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/alpm.c7
1 files changed, 6 insertions, 1 deletions
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)) {