]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make BridgeDistribution setting validator case-insensitive.
authorAlexander Færøy <ahf@torproject.org>
Wed, 15 Jan 2020 17:21:10 +0000 (17:21 +0000)
committerAlexander Færøy <ahf@torproject.org>
Wed, 15 Jan 2020 17:21:10 +0000 (17:21 +0000)
This patch makes sure that we accept values such as "nOne", "None", and
"AnY" as valid values for BridgeDistribution. We later ensure to
lower-case the values before they are forwarded to the BridgeDB.

See: https://bugs.torproject.org/32753

src/feature/relay/relay_config.c

index 9895485c83f8f03efb0a4e1a6f9837ad5f841b16..b919e5600b0650fdca69bd632921e521a0f23ce5 100644 (file)
@@ -485,7 +485,7 @@ check_bridge_distribution_setting(const char *bd)
   };
   unsigned i;
   for (i = 0; i < ARRAY_LENGTH(RECOGNIZED); ++i) {
-    if (!strcmp(bd, RECOGNIZED[i]))
+    if (!strcasecmp(bd, RECOGNIZED[i]))
       return 0;
   }