]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
app/config: reject non-UTF-8 ContactInfo
authorcypherpunks <cypherpunks@torproject.org>
Mon, 3 Sep 2018 13:51:29 +0000 (13:51 +0000)
committercypherpunks <cypherpunks@torproject.org>
Mon, 3 Sep 2018 14:31:03 +0000 (14:31 +0000)
Closes ticket #27428.

changes/bug27428 [new file with mode: 0644]
src/app/config/config.c

diff --git a/changes/bug27428 b/changes/bug27428
new file mode 100644 (file)
index 0000000..86e00c7
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (torrc):
+    - Tor now validates that the ContactInfo config option is valid UTF-8
+      when parsing torrc. Fixes bug 27428; bugfix on 0.0.8pre1.
index 339f8e2475990f4f752a829110009796b58953b1..cd76efd45b549ac47225958c44b2ecdfd38753c4 100644 (file)
@@ -3381,6 +3381,9 @@ options_validate(or_options_t *old_options, or_options_t *options,
     log_notice(LD_CONFIG, "Your ContactInfo config option is not set. "
         "Please consider setting it, so we can contact you if your server is "
         "misconfigured or something else goes wrong.");
+  const char *ContactInfo = options->ContactInfo;
+  if (ContactInfo && !string_is_utf8(ContactInfo, strlen(ContactInfo)))
+    REJECT("ContactInfo config option must be UTF-8.");
 
   /* Special case on first boot if no Log options are given. */
   if (!options->Logs && !options->RunAsDaemon && !from_setconf) {