#411 closed defect (fixed)
misallocation with ngx_mail_smtp_module at STARTTLS
Reported by: | markus-linnala.myopenid.com | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.3.x |
Keywords: | Cc: | ||
uname -a: | |||
nginx -V: | nginx version: nginx/1.5.5 |
Description
I modified http://mdounin.ru/hg/nginx-tests to use valgrind.
Test was mail_imap.t
==10647== Invalid write of size 1
==10647== at 0x4B1493: ngx_mail_smtp_merge_srv_conf (ngx_mail_smtp_module.c:280)
==10647== by 0x4AB363: ngx_mail_block (ngx_mail.c:209)
==10647== by 0x4303BE: ngx_conf_parse (ngx_conf_file.c:391)
==10647== by 0x42DF03: ngx_init_cycle (ngx_cycle.c:265)
==10647== by 0x4206A9: main (nginx.c:333)
==10647== Address 0x550fb84 is 0 bytes after a block of size 68 alloc'd
==10647== at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==10647== by 0x43B251: ngx_alloc (ngx_alloc.c:22)
==10647== by 0x421B0D: ngx_malloc (ngx_palloc.c:119)
==10647== by 0x421B65: ngx_pnalloc (ngx_palloc.c:147)
==10647== by 0x4B1447: ngx_mail_smtp_merge_srv_conf (ngx_mail_smtp_module.c:269)
==10647== by 0x4AB363: ngx_mail_block (ngx_mail.c:209)
==10647== by 0x4303BE: ngx_conf_parse (ngx_conf_file.c:391)
==10647== by 0x42DF03: ngx_init_cycle (ngx_cycle.c:265)
==10647== by 0x4206A9: main (nginx.c:333)
==10647==
Clearly memory for second CR + LF is not allocated.
Attachments (1)
Change History (7)
by , 11 years ago
Attachment: | valgrind-mail-misalloc.patch added |
---|
comment:1 by , 11 years ago
Status: | new → accepted |
---|
comment:2 by , 11 years ago
I wondered about extra CRLF. But after some delibration I choose not to drop extra CRLF. Currently I can not test change as mail proxy as a proper configuration I do not want to change what nginx sends. This extra CRLF has been from the start of mail implementation as far as I was able to see.
I have submitted patch via nginx-devel mailing list as per documentation.
comment:6 by , 8 years ago
sensitive: | 1 → 0 |
---|
It looks like the proper fix would be to just remove extra CRLF. Care to provide a patch following http://nginx.org/en/docs/contributing_changes.html?