Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

avoided invalid memory access in some RTxxx macros (see KAME PR 439)

(not sure if the invalid access can really happen, but did it for safety)
  • Loading branch information...
commit 7466875fd7063e7cde9035897b380774e06cf71a 1 parent 353dac1
jinmei authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 netbsd/sys/net/route.h
View
6 netbsd/sys/net/route.h
@@ -314,7 +314,7 @@ do { \
(rt)->rt_use++; \
(rt)->rt_lastreftime = time.tv_sec; \
i = ((rt)->rt_lastreftime - (rt)->rt_createtime) / 300; \
- if (i > 12) \
+ if (i < 0 || i > 12) \
i = 12; \
(rt)->rt_usehist[i]++; \
} while (0)
@@ -323,7 +323,7 @@ do { \
do { \
int i; \
i = (time.tv_sec - (rt)->rt_createtime) / 300; \
- if (i > 12) \
+ if (i < 0 || i > 12) \
i = 12; \
(rt)->rt_reusehist[i]++; \
} while (0)
@@ -332,7 +332,7 @@ do { \
do { \
int i; \
i = (time.tv_sec - (rt)->rt_createtime) / 300; \
- if (i > 12) \
+ if (i < 0 || i > 12) \
i = 12; \
(rt)->rt_releasehist[i]++; \
} while (0)
Please sign in to comment.
Something went wrong with that request. Please try again.