[syslog-ng]SEGV when parsing localip - version 1.5.23

Nigel Metheringham Nigel.Metheringham@InTechnology.co.uk
05 Dec 2002 16:14:34 +0000


I'm getting the same SEGV when a localip is specified as was described
at the bottom of this message:-
        http://lists.balabit.hu/pipermail/syslog-ng/2002-September/003853.html

Having looked at it further, looks like this function in afinet.c is the
culprit
        void inet_address_setip(struct address_info **a, const char *ip)
        {
        	CAST(inet_address_info, addr, *a);
        	if (addr) {
        		*a = &make_inet_address_c(ip, NULL)->super;
        	}
        	else {
        		ol_string_free(addr->ip);
        		addr->ip = c_format("%z", ip);
        	}
        }

The if (addr) tests if addr is NULL, and if it *is* it is then addr->ip
is dereferenced causing a SEGV.   Looks to me as though the if and else
parts are swapped over.  I'm going to experiment with that as a fix.


	Nigel.
-- 
[ Nigel Metheringham           Nigel.Metheringham@InTechnology.co.uk ]
[ - Comments in this message are my own and not ITO opinion/policy - ]