Opened 14 years ago

Last modified 14 years ago

#597 new defect

More than one level of configuration file inclusion causes infinite recursion

Reported by: holmgren@… Owned by: reimar
Priority: normal Component: core
Version: 1.0pre8 Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:


  1. ~/mplayer/mencoder.conf includes a first file, which in turn includes a

second file. m_config_parse_config_file() calls m_config_set_option() which
calls m_config_parse_option().

  1. m_config_parse_option() calls m_option_parse() (inline), which causes

parse_func_pf() to be called.

  1. parse_func_pf() adds an m_func_save_t with name="include" and param="(the

path to the first file)" to the end of the linked list pointed to by dst, i.e.
co->slots->data in the context of m_config_parse_option().

  1. m_config_parse_option() then calls m_option_set() (inline), which causes

set_func_param() to be called.

  1. set_func_param() goes through *all* of the same linked list and calls opt-

    p, i.e. cfg_include(), with the param field of each m_func_save_t item.

  1. There is an include option in the included file, as already mentioned.
  1. parse_func_pf() is called again and adds an m_func_save_t with param="(the

path to the second file") to the *end* of the co->slots->data linked list. It's
the same co, because co is a pointer to a configuration option info structure,
not a specific instance of an option in a file or on the command line.

  1. set_func_param() is called and again goes through the whole list, starting

with the *first* file - repeat ad infinitum.

This is where it goes wrong. I don't know how it was meant to work, so I can't
suggest a patch.

Change History (0)

Note: See TracTickets for help on using tickets.