[tor-commits] [metrics-lib/master] Accept transport lines containing more than just the transport name.

karsten at torproject.org karsten at torproject.org
Mon Aug 6 06:11:38 UTC 2012


commit 25f0e656c467121c9316876584b1762e7d4bd166
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Mon Aug 6 08:08:44 2012 +0200

    Accept transport lines containing more than just the transport name.
    
    Sanitized bridge descriptors contain transport lines with just the
    transport name.  However, there are now relays including unsanitized
    transport lines, most likely because of a configuration problem.  Don't
    reject the entire descriptor when encountering those lines.
---
 .../descriptor/impl/ExtraInfoDescriptorImpl.java   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java b/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
index 0a0bf1a..45848d2 100644
--- a/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
+++ b/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
@@ -571,7 +571,7 @@ public class ExtraInfoDescriptorImpl extends DescriptorImpl
 
   private void parseTransportLine(String line, String lineNoOpt,
       String[] partsNoOpt) throws DescriptorParseException {
-    if (partsNoOpt.length != 2) {
+    if (partsNoOpt.length < 2) {
       throw new DescriptorParseException("Illegal line '" + line + "'.");
     }
     this.transports.add(partsNoOpt[1]);



More information about the tor-commits mailing list