Bug in getservice.c since last update

Pirmin Walthert infos at nappsoft.com
Wed Aug 25 08:39:08 UTC 2010


It seems like the "fix reading service lines 2 > 80 chars" patch (git
72e1a1ce186c39f07282398e2af9eb0253e60f15) introduced a new bug.

Testcase:

#include <netdb.h>
#include <stdio.h>
int main(void) {
	if (getservbyname("bla", "udp") == NULL)
		err(1, "getservbyname");
	return 0;
}

As soon as the service is not known, getservbyname will loop forever.

For example a faulty iptables command (iptables -I INPUT -p tcp --dport
bla -j ACCEPT) in a init-script will prevent a system from booting this
way.


Pirmin Walthert



More information about the uClibc mailing list