[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.3.3] avoid a signed/unsigned comparison.



commit 7483aef896654a02ae1fa7ae616fbd1f2c27f3c5
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue May 22 14:12:44 2018 -0400

    avoid a signed/unsigned comparison.
---
 src/or/protover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/protover.c b/src/or/protover.c
index ae6cda092..13dd6549e 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -201,7 +201,7 @@ parse_single_entry(const char *s, const char *end_of_entry)
     goto error;
 
   /* The name must not be longer than MAX_PROTOCOL_NAME_LENGTH. */
-  if (equals - s > MAX_PROTOCOL_NAME_LENGTH) {
+  if (equals - s > (int)MAX_PROTOCOL_NAME_LENGTH) {
     log_warn(LD_NET, "When parsing a protocol entry, I got a very large "
              "protocol name. This is possibly an attack or a bug, unless "
              "the Tor network truly supports protocol names larger than "



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits