[or-cvs] r12395: Fix warning about overflow optimization. (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Nov 6 14:21:08 UTC 2007


Author: nickm
Date: 2007-11-06 09:21:08 -0500 (Tue, 06 Nov 2007)
New Revision: 12395

Modified:
   tor/trunk/
   tor/trunk/src/or/command.c
Log:
 r16452 at catbus:  nickm | 2007-11-06 09:20:08 -0500
 Fix warning about overflow optimization.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16452] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/command.c
===================================================================
--- tor/trunk/src/or/command.c	2007-11-06 14:19:14 UTC (rev 12394)
+++ tor/trunk/src/or/command.c	2007-11-06 14:21:08 UTC (rev 12395)
@@ -695,7 +695,7 @@
     goto err;
   }
   len = ntohs(get_uint16(cell->payload));
-  if (len < 2 || 2+len > CELL_PAYLOAD_SIZE) {
+  if (len < 2 || len > CELL_PAYLOAD_SIZE - 2) {
     log_fn(LOG_PROTOCOL_WARN, LD_OR, "Bad length field (%d) on LINK_AUTH cell;"
            " closing the connection", (int)len);
     goto err;



More information about the tor-commits mailing list