Bug in timer{add,sub} compatibility functions
< Vektor> i have another bugfix for tor
< Vektor> replace:
< Vektor> #define timeradd(tv1,tv2,tvout) \
< Vektor> do { \
< Vektor> (tvout)->tv_sec = (tv1)->tv_sec + (tv2)->tv_sec; \
< Vektor> (tvout)->tv_usec = (tv2)->tv_usec + (tv2)->tv_usec; \
< Vektor> with:
< Vektor> #define timeradd(tv1,tv2,tvout) \
< Vektor> do { \
< Vektor> (tvout)->tv_sec = (tv1)->tv_sec + (tv2)->tv_sec; \
< Vektor> (tvout)->tv_usec = (tv1)->tv_usec + (tv2)->tv_usec; \
< Vektor> and replace:
< Vektor> #define timersub(tv1,tv2,tvout) \
< Vektor> do { \
< Vektor> (tvout)->tv_sec = (tv1)->tv_sec - (tv2)->tv_sec; \
< Vektor> (tvout)->tv_usec = (tv2)->tv_usec - (tv2)->tv_usec; \
< Vektor> with:
< Vektor> #define timersub(tv1,tv2,tvout) \
< Vektor> do { \
< Vektor> (tvout)->tv_sec = (tv1)->tv_sec - (tv2)->tv_sec; \
< Vektor> (tvout)->tv_usec = (tv1)->tv_usec - (tv2)->tv_usec; \
These definitions are only used in platforms where timersub
and timeradd
are not defined.
timeradd
doesn't seem to be used anywhere in the code, and timersub
only seems to be used in circuit_expire_building()
.
At first glance, the issue doesn't seem security related, but we should look at it carefully.