aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/versions.c
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2020-06-17 11:50:27 -0700
committerGeorge Kadianakis <desnacked@riseup.net>2020-06-24 17:22:45 +0300
commit1bd0494f8c3375c1b6698bf4e6d4d8be324ba934 (patch)
treeede9774bb38aafb0764b8244e5853d80133e0f13 /src/core/or/versions.c
parent48ff6a41aed1e2b57f1766206324bc9dc33c19d1 (diff)
downloadtor-1bd0494f8c3375c1b6698bf4e6d4d8be324ba934.tar.gz
tor-1bd0494f8c3375c1b6698bf4e6d4d8be324ba934.zip
Make summarize_protover_flags() handle NULL and empty string the same
Diffstat (limited to 'src/core/or/versions.c')
-rw-r--r--src/core/or/versions.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/or/versions.c b/src/core/or/versions.c
index 2f8cbac0e9..5dfe0c2cc9 100644
--- a/src/core/or/versions.c
+++ b/src/core/or/versions.c
@@ -490,8 +490,8 @@ memoize_protover_summary(protover_summary_flags_t *out,
/** Summarize the protocols listed in <b>protocols</b> into <b>out</b>,
* falling back or correcting them based on <b>version</b> as appropriate.
*
- * If protocols and version are both NULL, returns a summary with no flags
- * set.
+ * If protocols and version are both NULL or "", returns a summary with no
+ * flags set.
*
* If the protover string does not contain any recognised protocols, and the
* version is not recognised, sets protocols_known, but does not set any other
@@ -504,10 +504,10 @@ summarize_protover_flags(protover_summary_flags_t *out,
{
tor_assert(out);
memset(out, 0, sizeof(*out));
- if (protocols) {
+ if (protocols && strcmp(protocols, "")) {
memoize_protover_summary(out, protocols);
}
- if (version && !strcmpstart(version, "Tor ")) {
+ if (version && strcmp(version, "") && !strcmpstart(version, "Tor ")) {
if (!out->protocols_known) {
/* The version is a "Tor" version, and where there is no
* list of protocol versions that we should be looking at instead. */