check results of parseip. Reference: /n/sources/patch/applied/ipinfochk Date: Thu Apr 17 20:14:26 CES 2008 Signed-off-by: quanstro@quanstro.net --- /sys/src/libndb/ndbipinfo.c Thu Apr 17 20:14:20 2008 +++ /sys/src/libndb/ndbipinfo.c Thu Apr 17 20:14:18 2008 @@ -188,7 +188,10 @@ t = ndbnew("ip", val); t->line = t; t->entry = nil; - parseip(net, val); + if(parseip(net, val) == -1){ + ndbfree(f); + return nil; + } } else { /* found one */ while(nt != nil){ @@ -196,7 +199,11 @@ t = ndbconcatenate(t, nt); nt = ndbsnext(&s, attr, val); } - parseip(net, ipstr); + if(parseip(net, ipstr) == -1){ + free(ipstr); + ndbfree(f); + return nil; + } free(ipstr); } ipmove(ip, net);