Re: [exim-dev] DCC header corruption

Top Pagina
Delete this message
Reply to this message
Auteur: Marcin Mirosław
Datum:  
Aan: exim-dev
Onderwerp: Re: [exim-dev] DCC header corruption
W dniu 18.05.2012 12:53, Northfield Stuart pisze:
> (Second attempt at submitting this as first message seems to have disappeared down a black hole.)
>
> I have recently been experiencing corruption and/or truncation of the DCC header being logged and added to my messages using the built-in exim dcc support in the data acl.
>
> Upon investigation, I note that in dcc.c the global dcc_header is being pointed at a stack based string before the dcc code returns, despite the fact that there appears to be a (currently unused) global char array dcc_header_str which is presumably intended to have the header copied in to it and then dcc_header pointed at that.
>
> 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));
>
> seems to cure the problem for me, although being unfamiliar with Exim's source base, it's not clear to me if this is the correct solution.


Hello!
Could it be problem founded by clang analyzer[1]? After applying your
patch those report disappear from scan result, this is why i suspect
clang analyzer found real problem. I appreciative feedback if clang
anaylze was correct or wrong.
Regards,
Marcin

[1] - http://mejor.pl/exim-4.77/report-QnPhZj.html#EndPath