Re: Tracking Heap Corruption bug FOUND!

Eugene Crosser <[email protected]> Wed, 24 Oct 2007 18:39:30 +0400
Newsgroups gmane.mail.spam.spf.devel
Message-ID <[email protected]>
David Hinkle wrote:

> Maybe fixing this will become trivial for someone with more experience

> First invalid write:
> 
> ==30539== Invalid write of size 1
> ==30539==    at 0x401BD48: memcpy (in
> /usr/local/lib/valgrind/x86-linux/vgpreload_memcheck.so)
> ==30539==    by 0x4064E74: SPF_dns_resolv_lookup (spf_dns_resolv.c:404)

Hmm, I wonder if it would help to change src/libspf2/spf_dns_resolv.c
line 399 from

    while ( rdlen > 0 )

to

    while ( rdlen > 1 )

I need to check it when I have time...

Actually, I would *very* much like to have a check added after line 401,
something like

if (len >= rdlen) {
  complan_very_very_loudly();
  len=rdlen-1;
}

Eugene

-------------------------------------------
-----------------------------------------------------------------------
To unsubscribe, change your address, or temporarily deactivate your
subscription,
please go to http://v2.listbox.com/member/?member_id=6959932&id_secret=57044699-44a606
Powered by Listbox: http://www.listbox.com
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHH1kmfrw/cIw6UWkRAtMKAKCpfooTIjp4Tp9S7dcNcejudTsmxwCeNa8/
7TaFxVYN9VIQrkVAzaFUC/c=
=i8jE
-----END PGP SIGNATURE-----