Re: [exim-dev] DCC header corruption

Pàgina inicial
Delete this message
Reply to this message
Autor: Northfield Stuart
Data:  
A: Wolfgang Breyha
CC: exim-dev
Assumpte: Re: [exim-dev] DCC header corruption
>> Replacing the following line (483 in my copy of src/dcc.c):
>>
>> dcc_header = xhdr;
>>
>> with
>>
>> strncpy(dcc_header = dcc_header_str, xhdr, sizeof(dcc_header_str));
>
> After a first look ... you're absolutely right. I didn't recognized that,
> because I use "direct_add_header";-)
>
> I'll file a bug in the evening to hopefully get the fix in 4.80.



Thanks Wolfgang.

For the record, I believe the issue surface when I changed my data acl use of dcc from this:

  warn  message     = $dcc_header
        log_message = DCC: $dcc_header
        dcc         = */defer_ok


to the following:

  warn  dcc         = */defer_ok
        add_header  = $dcc_header
        log_message = DCC: $dcc_header


The effect I observe is that either the string is truncated and appears thus:

X-Dcc-Metrics:     mop.metanate.com 1290; Body=1 Fuz1=man
X-Dcc-Metrics:     mop.metanate.com 1290; Body=1 Fuz1=1 F


or alternatively, garbage characters overwrite the end of the header thus:

X-Dcc-Metrics:     Mop.local 1290; Body=52 Fuz1=69 Fuz2=m?€E?¿ÿö


a combination which suggested to me that the string buffer was being overwritten - which would tie in with returning a pointer to a stack based string.

I guess the change in the order of things in my acl changed the memory usage sufficiently to cause the freed stack memory to be reused and corrupt the string.

Regards

Stu

--
Stuart Northfield
+44 (0) 1223 566759 (Direct), +44 (0) 1223 566727 (Fax)
Metanate Limited. Registered in England No 4046086 at:
Lincoln House, Station Court, Great Shelford, Cambridge CB22 5NE, UK
www.metanate.com (Consultancy) www.schemus.com (Data synchronisation)

This e-mail and all attachments it may contain is confidential and
intended solely for the use of the individual to whom it is addressed.
Any views or opinions presented are those of the author and do not
necessarily represent those of Metanate Ltd. If you are not the
intended recipient, be advised that you have received this e-mail in
error and that any use, dissemination, printing, forwarding or copying
of this e-mail is strictly prohibited. Please contact the sender if
you have received this e-mail in error.