diff -u djbdns-1.05/rbldns-data.c djbdns-1.05-patched/rbldns-data.c --- djbdns-1.05/rbldns-data.c Sun Feb 11 16:11:45 2001 +++ djbdns-1.05-patched/rbldns-data.c Thu Oct 10 01:19:25 2002 @@ -28,6 +28,7 @@ int fdcdb; struct cdb_make cdb; static stralloc tmp; +static stralloc tmp2; static stralloc line; int match = 1; @@ -105,14 +106,29 @@ } if (!stralloc_catb(&tmp,"\0\0\0\0",4)) nomem(); tmp.len = 4; - if (line.s[j] == '/') - scan_ulong(line.s + j + 1,&u); + if (line.s[j] == '/') { + k = scan_ulong(line.s + j + 1,&u); + j += k + 1 ; + } else u = 32; if (u > 32) u = 32; ch = u; if (!stralloc_catb(&tmp,&ch,1)) nomem(); - if (cdb_make_add(&cdb,tmp.s,tmp.len,"",0) == -1) + if ( line.s[j] == ':' ) { + ip[0]=ip[1]=ip[2]=ip[3]=0 ; + j++ ; + j += ip4_scan(line.s+j,ip) ; + if (!stralloc_copyb(&tmp2,ip,4)) nomem(); + if ( line.s[j] == ':' ) { + j ++ ; + if (!stralloc_catb(&tmp2,line.s+j,line.len-j-1)) nomem(); + } + } + else { + if (!stralloc_copyb(&tmp2,"",0)) nomem(); + } + if (cdb_make_add(&cdb,tmp.s,tmp.len,tmp2.s,tmp2.len) == -1) die_datatmp(); break; } diff -u djbdns-1.05/rbldns.c djbdns-1.05-patched/rbldns.c --- djbdns-1.05/rbldns.c Sun Feb 11 16:11:45 2001 +++ djbdns-1.05-patched/rbldns.c Thu Oct 10 01:31:58 2002 @@ -48,15 +48,21 @@ } if (!r) { response_nxdomain(); return 1; } - r = cdb_find(&c,"",0); - if (r == -1) return 0; - if (r && ((dlen = cdb_datalen(&c)) >= 4)) { + if ((dlen=cdb_datalen(&c))>=4) { if (dlen > 100) dlen = 100; if (cdb_read(&c,data,dlen,cdb_datapos(&c)) == -1) return 0; } else { - dlen = 12; - byte_copy(data,dlen,"\177\0\0\2Listed $"); + r = cdb_find(&c,"",0); + if (r == -1) return 0; + if (r && ((dlen = cdb_datalen(&c)) >= 4)) { + if (dlen > 100) dlen = 100; + if (cdb_read(&c,data,dlen,cdb_datapos(&c)) == -1) return 0; + } + else { + dlen = 12; + byte_copy(data,dlen,"\177\0\0\2Listed $"); + } } if ((dlen >= 5) && (data[dlen - 1] == '$')) {