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
This commit is contained in:
Aaron Griffin 2006-10-27 21:15:26 +00:00
parent 3e5401b74d
commit a4355d8d73
1 changed files with 6 additions and 1 deletions

View File

@ -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)) {