Hi,
sorry, but I had no luck with 0.49, there were some stack overflow and
off-by-one bugs sleeping since longer time, but now rising up during
compiling with some protection options.
Many credits to Radek Vokál for finding bugs and pointing out the snprintf
size problems.
Therefore I released now version 0.50:
Available at:
<ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/>
(and via CVS - note that DS6 currently contain only older versions).
Not-minor changes:
20050915/PB
various c files
- fix snprintf size parameter (credits to
Radek Vokál for pointing this out)
lib/libipv6addr.c#ipv6addr_copy
- fix bug which causes stack overflow (credits to
Radek Vokál for finding the bug)
several Makefiles
- add compiler switch -O2, reason for segfault was found
- remove also static on clean
ipv6logconv:
- add support for unique local unicast
update databases
Happier using now...
Peter
--
Dr. Peter Bieringer http://www.bieringer.de/pb/
GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de
Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/
--On Donnerstag, 15. September 2005 13:16 +0200 Radek Vokál
<rvokal(a)redhat.com> wrote:
> Hi Peter,
>
> again looking into the code, I found another stack corruption :)
> It's rather stupid off by one for tempstring when you forget about
> ending \0:
>
> --- ipv6calc/showinfo.c~ 2005-09-15 12:49:22.467626560 +0200
> +++ ipv6calc/showinfo.c 2005-09-15 12:49:22.467626560 +0200
> @@ -286,7 +286,7 @@
> #define DEBUG_function_name "showinfo_ipv6addr"
> int showinfo_ipv6addr(const ipv6calc_ipv6addr *ipv6addrp1, const
> uint32_t formatoptions) {
> int retval = 1, i, j, flag_prefixuse, registry;
> - char tempstring[NI_MAXHOST] = "", helpstring[NI_MAXHOST] = "";
> + char tempstring[NI_MAXHOST+1] = "", helpstring[NI_MAXHOST+1] =
> "";
> ipv6calc_ipv6addr ipv6addr, *ipv6addrp;
> ipv6calc_ipv4addr ipv4addr;
> ipv6calc_macaddr macaddr;
>
> Also using of
>
> snprintf(helpstring, sizeof(tempstring), "%s,", tempstring);
>
> is not very nice but here sort of harmless because helpstring and
> tempstring are the same size. But it's not so right anyway ..
Unfortunately, this bug is everywhere...no wonder that showinfo crashed
also by me...will fix them now all.
Peter
--
Dr. Peter Bieringer http://www.bieringer.de/pb/
GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de
Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/
Hi Radek,
--On Donnerstag, 15. September 2005 10:47 +0200 Radek Vokál
<rvokal(a)redhat.com> wrote:
> Hi Peter,
>
> so here's the bug I found in your code. Seems like you overwrite the
> stack in ipv6addr_copy, because you shift the address by i in the stack
> and than you "successfully" copy the structure 48x times in the stack.
Ooops...wondering how it has ever worked.
> So correct copying of the structure is just *dst = *src (this works as
> copy for structures so no need to do some memcpy stuff)
Thank you very much for the patch, confirmed working, submitted to CVS now.
Looks like this was also the reason that -O2 causes problems, reenabled it
now.
I will release version 0.50 tonight MEST.
Peter
--
Dr. Peter Bieringer http://www.bieringer.de/pb/
GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de
Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/
Hi,
after a while I released finally version 0.49
Available at:
<ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/>
(and via CVS - note that DS6 currently contain only older versions).
Not-minor changes:
20050914/PB
Update databases
20050725/PB
lib/libipv6addr
ipv6calc/showinfo
- add support for Unique Local IPv6 Unicast Addresses
20050719/PB
md5/md5.c
- fix for proper support of big endian machines
lib/libipv6addr
- replace hardcoded IPv6 assignement by dynamic one
20050714/PB
lib/libipv6addr
- IPv6 TLA update
20050628/PB
ipv6calc:
- replace hardcoded $(root)/bin with $(root)@bindir@ (suggested by
Andrew Walrond)
20050212/PB
ipv6logconv:
- implement a lookup cache for speed-up (around 20%)
lib/libipv4addr
databases/ipv4-assignment/dbipv4addr_assignment.h
- add a hint table for speed-up IPv4 registry lookups (around 10
times!)
Happy using,
Peter
--
Dr. Peter Bieringer http://www.bieringer.de/pb/
GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de
Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/