nodelist: use strcmpstart() instead of strncmp()

in rend_parse_v2_service_descriptor.
Fix on c58675ca72
This commit is contained in:
cypherpunks 2018-09-11 00:41:32 +00:00
parent 19dbc385d5
commit ab91302fd0
2 changed files with 4 additions and 2 deletions

3
changes/ticket27630 Normal file
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.

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;
}