commit f8c0f694b7f335358f612b0a26aae8b48110fa50 Author: cypherpunks cypherpunks@torproject.org Date: Mon Sep 3 13:51:29 2018 +0000
app/config: reject non-UTF-8 ContactInfo
Closes ticket #27428. --- changes/bug27428 | 3 +++ src/app/config/config.c | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/changes/bug27428 b/changes/bug27428 new file mode 100644 index 000000000..86e00c7db --- /dev/null +++ b/changes/bug27428 @@ -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. diff --git a/src/app/config/config.c b/src/app/config/config.c index 339f8e247..cd76efd45 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -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) {
tor-commits@lists.torproject.org