aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 1402462fb0..53e117f24c 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1081,8 +1081,13 @@ string_is_valid_dest(const char *string)
int retval;
size_t len = strlen(string);
- tor_assert(string);
- tor_assert(len > 0);
+ if (string == NULL)
+ return 0;
+
+ len = strlen(string);
+
+ if (len == 0)
+ return 0;
if (string[0] == '[' && string[len - 1] == ']')
string = tmp = tor_strndup(string + 1, len - 2);