]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
avoid a signed/unsigned comparison.
authorNick Mathewson <nickm@torproject.org>
Tue, 22 May 2018 18:12:44 +0000 (14:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 22 May 2018 18:12:44 +0000 (14:12 -0400)
src/or/protover.c

index ae6cda092b1084c1bb7bb4ee40e3b72b87ab1eb9..13dd6549e8d085c010403710cdd73dd59a09b33e 100644 (file)
@@ -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 "