X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/blobdiff_plain/87e46054b4db54320b42bd44da7d7267f06c1ae0..11f553d9f026246210de6d18352f4ae78a03e6aa:/src/query.c diff --git a/src/query.c b/src/query.c index 666fdd7..f710d3e 100644 --- a/src/query.c +++ b/src/query.c @@ -113,7 +113,7 @@ int adns_submit(adns_state ads, adns_query *query_r) { qcontext ctx; int id, r, ol; - vbuf vb; + vbuf vb, search_vb; adns_status stat; const typeinfo *typei; struct timeval now; @@ -131,9 +131,9 @@ int adns_submit(adns_state ads, adns__vbuf_init(&vb); ol= strlen(owner); - if (ol<=1 || ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto xit; } + if (ol>DNS_MAXDOMAIN+1) { stat= adns_s_querydomaintoolong; goto xit; } - if (owner[ol-1]=='.' && owner[ol-2]!='\\') { flags &= ~adns_qf_search; ol--; } + if (ol>=2 && owner[ol-1]=='.' && owner[ol-2]!='\\') { flags &= ~adns_qf_search; ol--; } stat= adns__mkquery(ads,&vb,&id, owner,ol, typei,flags);