projects
/
dnssec-prover
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c54ddf7
)
Return early if we get a response with no answers
author
Matt Corallo
<git@bluematt.me>
Thu, 8 Feb 2024 05:47:15 +0000
(
05:47
+0000)
committer
Matt Corallo
<git@bluematt.me>
Thu, 8 Feb 2024 05:47:15 +0000
(
05:47
+0000)
src/query.rs
patch
|
blob
|
history
diff --git
a/src/query.rs
b/src/query.rs
index d81e58a1e1d20eb869b91a59203dd19e61093da1..6f68e09707b210798e7e9f846a528bdadbc9fa1b 100644
(file)
--- a/
src/query.rs
+++ b/
src/query.rs
@@
-69,6
+69,7
@@
fn handle_response(resp: &[u8], proof: &mut Vec<u8>) -> Result<Option<RRSig>, Er
let questions = emap(read_u16(&mut read))?;
if questions != 1 { return Err(Error::new(ErrorKind::Other, "server responded to multiple Qs")); }
let answers = emap(read_u16(&mut read))?;
+ if answers == 0 { return Err(Error::new(ErrorKind::Other, "No answers")); }
let _authorities = emap(read_u16(&mut read))?;
let _additional = emap(read_u16(&mut read))?;