Merge remote-tracking branch 'onionk/strcmpstart1'

This commit is contained in:
Nick Mathewson
2018-09-13 13:30:53 -04:00
3 changed files with 5 additions and 3 deletions
+3
View File
@@ -0,0 +1,3 @@
o Code simplification and refactoring:
- Use the simpler strcmpstart() helper in rend_parse_v2_service_descriptor
instead of strncmp(). Closes ticket 27630.
+1 -1
View File
@@ -201,7 +201,7 @@ networkstatus_reset_download_failures(void)
/**
* Read and and return the cached consensus of type <b>flavorname</b>. If
* <b>unverified</b> is false, get the one we haven't verified. Return NULL if
* <b>unverified</b> is true, get the one we haven't verified. Return NULL if
* the file isn't there. */
static char *
networkstatus_read_cached_consensus_impl(int flav,
+1 -2
View File
@@ -5167,8 +5167,7 @@ rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out,
tor_assert(desc);
/* Check if desc starts correctly. */
if (strncmp(desc, "rendezvous-service-descriptor ",
strlen("rendezvous-service-descriptor "))) {
if (strcmpstart(desc, "rendezvous-service-descriptor ")) {
log_info(LD_REND, "Descriptor does not start correctly.");
goto err;
}