From 0163efdf5c6c6f2c5d7b95fe09a2dfa3cce9d114 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 2 Nov 2021 20:44:51 -0700 Subject: [PATCH] remove file size limit on GVC config While it is probably not a good idea to have a GVC config that is 100000 bytes, I see no reason it should be arbitrarily rejected. In future, it might be a good idea to make `gvconfig_plugin_install_from_config` accept a file pointer instead of a string and read/parse the config file incrementally. If this were done, then there would probably be no issue at all with large configs. --- CHANGELOG.md | 1 + lib/gvc/gvconfig.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a496d3807..ad595527c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Check for existence of `dl_iterate_phdr(3)` and if it is available, prefer using it instead of iterating over `/proc/self/maps` for computing `libdir`. +- A limit on GVC config files of 100000 bytes has been removed. ### Fixed diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index a4dda4cc0..78b8789ed 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -559,7 +559,6 @@ void gvconfig(GVC_t * gvc, boolean rescan) char *libdir; char *config_file_name = GVPLUGIN_CONFIG_FILE; -#define MAX_SZ_CONFIG 100000 #endif /* builtins don't require LTDL */ @@ -599,9 +598,6 @@ void gvconfig(GVC_t * gvc, boolean rescan) /* silently return without setting gvc->config_found = TRUE */ return; } - else if (config_st.st_size > MAX_SZ_CONFIG) { - agerr(AGERR,"%s is bigger than I can handle.\n", gvc->config_path); - } else { f = fopen(gvc->config_path,"r"); if (!f) { -- 2.49.0