Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/dns.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | do { | ||||
return 0; | return 0; | ||||
} | } | ||||
// add dot in output | // add dot in output | ||||
if (!init) { | if (!init) { | ||||
if (bufused == bufsize - 1) { | if (bufused == bufsize - 1) { | ||||
return -2; | return -2; | ||||
} | } | ||||
buf[bufused++] = '.'; | buf[bufused++] = '.'; | ||||
} else | } else { | ||||
init = 0; | init = 0; | ||||
} | |||||
// handle references | // handle references | ||||
if ((octet & 0xC0) == 0xC0) { | if ((octet & 0xC0) == 0xC0) { | ||||
if (*inpos == inend) { | if (*inpos == inend) { | ||||
return -1; | return -1; | ||||
} | } | ||||
int ref = ((octet - 0xC0) << 8) + *((*inpos)++); | int ref = ((octet - 0xC0) << 8) + *((*inpos)++); | ||||
if (ref < 0 || ref >= (*inpos) - inbuf - 2) { | if (ref < 0 || ref >= (*inpos) - inbuf - 2) { | ||||
return -1; | return -1; | ||||
▲ Show 20 Lines • Show All 577 Lines • Show Last 20 Lines |