]> granicus.if.org Git - graphviz/commitdiff
remove file size limit on GVC config
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 3 Nov 2021 03:44:51 +0000 (20:44 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 9 Nov 2021 15:10:39 +0000 (07:10 -0800)
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
lib/gvc/gvconfig.c

index a496d380747bcaa3d9164b19e1c62a60a0e083ea..ad595527c2fe9b99569f6febe934ea3cf5200136 100644 (file)
@@ -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
 
index a4dda4cc04595053cf3b2ce20cff3d49da38749c..78b8789ed6a7bbeb43df0d5d41b0e01f08ed51fe 100644 (file)
@@ -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) {