help-libidn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: two failures on libidn-1.22 testsuite


From: Simon Josefsson
Subject: Re: two failures on libidn-1.22 testsuite
Date: Wed, 04 May 2011 22:34:15 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (gnu/linux)

Guido Trentalancia <address@hidden> writes:

> ==8121== Invalid read of size 4
> ==8121==    at 0x4029E7: idna_to_ascii_4z (idna.c:519)
> ==8121==    by 0x402C64: idna_to_ascii_8z (idna.c:570)
> ==8121==    by 0x400D95: doit (tst_idna2.c:486)
> ==8121==    by 0x400B8C: main (utils.c:147)
> ==8121==  Address 0x51ca8d8 is 8 bytes inside a block of size 10 alloc'd
> ==8121==    at 0x4C282CD: malloc (vg_replace_malloc.c:236)
> ==8121==    by 0x402B30: idna_to_ascii_4z (idna.c:531)
> ==8121==    by 0x402C64: idna_to_ascii_8z (idna.c:570)
> ==8121==    by 0x400D95: doit (tst_idna2.c:486)
> ==8121==    by 0x400B8C: main (utils.c:147)

This is the same problem you reported before.  That line reads:

          char *newp = realloc (out, strlen (out) + 1 + strlen (buf) + 1);

What is happening here is that your strlen function is reading "out"
buffer in chunks of 4 and the buffer is 10 bytes, so it overruns.

So this is not a libidn problem.  I wouldn't call it a problem at all,
because this is most likely intentional (you have an efficient strlen),
but if you want to track down this further the place to look is for the
strlen implementation you are using.  It can be from your libc or your
compiler may inline a more efficient version of it.

My recommendation is that you either build with
--disable-valgrind-tests, or read up more about how valgrind works and
write a suppression file and point to it in your ~/.valgrindrc.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]