[exim-dev] [Bug 1122] New: Segmentation violation and lookup…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Alun Jones
Date:  
À: exim-dev
Nouveaux-sujets: [exim-dev] [Bug 1122] Segmentation violation and lookup problems from main config file, [exim-dev] [Bug 1122] Segmentation violation and lookup problems from main config file
Sujet: [exim-dev] [Bug 1122] New: Segmentation violation and lookup problems from main config file
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1122
           Summary: Segmentation violation and lookup problems from main
                    config file
           Product: Exim
           Version: 4.76
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: high
         Component: Lookups
        AssignedTo: nigel@???
        ReportedBy: auj@???
                CC: exim-dev@???



My exim config file has a line similar to the following:

localhost_number = ${lookup{hello}lsearch{/tmp/world}{$value}{255}}

In exim 4.76 (and possibly earlier - 4.72 is the last working version I've
tried) this causes a SEGV.

In readconf.c we have at lines 3190/3191:

uschar *s = expand_string(host_number_string);
long int n = Ustrtol(s, &end, 0);

i.e. the value returned by expand_string(host_number_string) is passed
directly to Ustrtol. If expand_string returns NULL then we get the SEGV.

I've changed these lines as follows:

  long int n;
  uschar *s = expand_string(host_number_string);
  if (s == NULL)
    log_write(0, LOG_MAIN|LOG_PANIC_DIE,
      "failed to expand localhost_number \"%s\": %s",
      host_number_string, expand_string_message);
  n = Ustrtol(s, &end, 0);


Which now at least gives me a panic message with the following:

expand_string_message: unknown lookup type "lsearch"

Which brings me to part 2...

lsearch appears not to exist because readconf_main() is called from exim.c
before init_lookup_list() is called. I tried moving this call to just before
readconf_main() and the problem goes away. But the comments around the call to
init_lookup_list() at line 3615 give a certain amount of concern about this as
a solution!


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email