Ticket #9386: 0001-Cleanup-prevent-repeated-use-of-p-oMr-to-avoid-mem-l.patch

File 0001-Cleanup-prevent-repeated-use-of-p-oMr-to-avoid-mem-l.patch, 2.4 KB (added by Pierre Labastie, 7 years ago)
  • doc/doc-docbook/spec.xfpt

    From 65e061b76867a9ea7aeeb535341b790b90ae6c21 Mon Sep 17 00:00:00 2001
    From: "Heiko Schlittermann (HS12-RIPE)" <hs@schlittermann.de>
    Date: Wed, 31 May 2017 23:08:56 +0200
    Subject: [PATCH] Cleanup (prevent repeated use of -p/-oMr to avoid mem leak)
    
    ---
     doc/doc-docbook/spec.xfpt |  3 ++-
     src/src/exim.c            | 19 +++++++++++++++++--
     2 files changed, 19 insertions(+), 3 deletions(-)
    
    diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
    index 06373ccd..7816bc26 100644
    a b or &%-bs%& is used. For &%-bh%&, the protocol is forced to one of the standard  
    42744274SMTP protocol names (see the description of &$received_protocol$& in section
    42754275&<<SECTexpvar>>&). For &%-bs%&, the protocol is always &"local-"& followed by
    42764276one of those same names. For &%-bS%& (batched SMTP) however, the protocol can
    4277 be set by &%-oMr%&.
     4277be set by &%-oMr%&. Repeated use of this option is not supported.
    42784278
    42794279.vitem &%-oMs%&&~<&'host&~name'&>
    42804280.oindex "&%-oMs%&"
    host name and its colon can be omitted when only the protocol is to be set.  
    43744374Note the Exim already has two private options, &%-pd%& and &%-ps%&, that refer
    43754375to embedded Perl. It is therefore impossible to set a protocol value of &`d`&
    43764376or &`s`& using this option (but that does not seem a real limitation).
     4377Repeated use of this option is not supported.
    43774378
    43784379.vitem &%-q%&
    43794380.oindex "&%-q%&"
  • src/src/exim.c

    diff --git a/src/src/exim.c b/src/src/exim.c
    index 67583e58..88e11977 100644
    a b for (i = 1; i < argc; i++)  
    31063106
    31073107      /* -oMr: Received protocol */
    31083108
    3109       else if (Ustrcmp(argrest, "Mr") == 0) received_protocol = argv[++i];
     3109      else if (Ustrcmp(argrest, "Mr") == 0)
     3110
     3111        if (received_protocol)
     3112          {
     3113          fprintf(stderr, "received_protocol is set already\n");
     3114          exit(EXIT_FAILURE);
     3115          }
     3116        else received_protocol = argv[++i];
    31103117
    31113118      /* -oMs: Set sender host name */
    31123119
    for (i = 1; i < argc; i++)  
    32023209
    32033210    if (*argrest != 0)
    32043211      {
    3205       uschar *hn = Ustrchr(argrest, ':');
     3212      uschar *hn;
     3213
     3214      if (received_protocol)
     3215        {
     3216        fprintf(stderr, "received_protocol is set already\n");
     3217        exit(EXIT_FAILURE);
     3218        }
     3219
     3220      hn = Ustrchr(argrest, ':');
    32063221      if (hn == NULL)
    32073222        {
    32083223        received_protocol = argrest;