artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04a899a
)
doh, not all requests are the same size. check len first.
author
tedu
<tedu@openbsd.org>
Thu, 15 Oct 2015 21:56:52 +0000
(21:56 +0000)
committer
tedu
<tedu@openbsd.org>
Thu, 15 Oct 2015 21:56:52 +0000
(21:56 +0000)
usr.sbin/rebound/rebound.c
patch
|
blob
|
history
diff --git
a/usr.sbin/rebound/rebound.c
b/usr.sbin/rebound/rebound.c
index
f5ba847
..
724fc60
100644
(file)
--- a/
usr.sbin/rebound/rebound.c
+++ b/
usr.sbin/rebound/rebound.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: rebound.c,v 1.
9 2015/10/15 21:39:15
tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.
10 2015/10/15 21:56:52
tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@
-123,7
+123,8
@@
cachelookup(struct dnspacket *dnsreq, size_t reqlen)
origid = dnsreq->id;
dnsreq->id = 0;
TAILQ_FOREACH(hit, &cache, cache) {
- if (memcmp(hit->req, dnsreq, reqlen) == 0)
+ if (hit->reqlen == reqlen &&
+ memcmp(hit->req, dnsreq, reqlen) == 0)
break;
}
dnsreq->id = origid;