[Opendnssec-develop] Bug in logging.c ?

Matthijs Mekking matthijs at NLnetLabs.nl
Wed Jan 27 11:15:02 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Absolutely right.

Thanks,

Matthijs

Marco Davids wrote:
> Hi there,
> 
> It seems to me that there is a bug in the 'facility2int' function in
> logging.c.
> 
>     else if (strncmp(dup, "LOCAL0", 6) && strlen(dup) == 6)
>         *fac = LOG_LOCAL0;
> 
> and all the other ones in that same statement seem to have the wrong
> effect. When 'dup' is 'LOCAL0', the return value of strncmp is zero,
> hence the if-statement will fail, where it was suppose to be succesful,
> 
> How about this?
> 
>     else if (strncmp(dup, "LOCAL0", 6) == 0 && strlen(dup) == 6)
>         *fac = LOG_LOCAL0;
> 
> Or
> 
>     else if (! strncmp(dup, "LOCAL0", 6) && strlen(dup) == 6)
>         *fac = LOG_LOCAL0;
> 
> Cheers,
> 
> --
> Marco Davids
> SIDN
> 
> 
> _______________________________________________
> Opendnssec-develop mailing list
> Opendnssec-develop at lists.opendnssec.org
> https://lists.opendnssec.org/mailman/listinfo/opendnssec-develop

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEcBAEBAgAGBQJLYCA0AAoJEA8yVCPsQCW5CcIH/i4Ib5NFAk5ygsUcDG3tSIxq
dHTuE9rQftdLmnFiMor3bfr4cbTEjCON1iy5257AwJVyKA4lgxIoweRvSii3UMdP
MiEdtX3WI30qTv8m4bY/zCkSrSNyiU3aPw8jjwjJz2guV78k85spntzHhBqGG768
2k7U0nlWbqxM+/n915XxpkrfoD2toC1/tn4rezNDYDUKkJhNFv4bTW/EDAv/a9ZF
2QvJcYpjQPDVG3BMHrApUmV78pMCy1hivZy03u0wsaDsIOlqPc10wH72BVehRDhz
yceYMs4eqVCPnVjBtMFDvtC5orWvLhY+L0/BkhZN6Bd8vstwN8GfE/avvaPbpMQ=
=foTB
-----END PGP SIGNATURE-----



More information about the Opendnssec-develop mailing list