Fix an always-true assert in string parsing
const char *err = strchr(cp, ':')+2;
tor_assert(err);
The assert would never work. Even if the function strchr returns NULL, then the pointer err will store an invalid value ((char *)2), but it won't be NULL. It would be correct to write the following:
const char *err = strchr(cp, ':');
tor_assert(err);
err += 2;
However, as I understand, the function strchr will never return NULL, and the check is written just in case.
Reported by Andrey Karpov https://www.viva64.com/en/b/0507/