Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 318
    • Issues 318
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 36
    • Merge requests 36
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #40306
Closed
Open
Created Feb 20, 2021 by Nick Mathewson@nickm🐻Owner

Coverity deadcode warnings in HSv2-related code

Looks like there's some new dead code now that HSv2 has gone the way of Flash?

Of possible interest for @dgoulet or @asn

________________________________________________________________________________________________________
*** CID 1473233:  Possible Control flow issues  (DEADCODE)
/src/feature/control/control_cmd.c: 1479 in handle_control_hsfetch()
1473           tor_assert_nonfatal_unreached();
1474         }
1475       }
1476     
1477       /* Using a descriptor ID, we force the user to provide at least one
1478        * hsdir server using the SERVER= option. */
>>>     CID 1473233:  Possible Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "hsdirs" inside this statement: "if (desc_id && (!hsdirs || ...".
1479       if (desc_id && (!hsdirs || !smartlist_len(hsdirs))) {
1480         control_write_endreply(conn, 512, "SERVER option is required");
1481         goto done;
1482       }
1483     
1484       /* We are about to trigger HSDir fetch so send the OK now because after

** CID 1473232:  Control flow issues  (DEADCODE)
/src/core/or/connection_edge.c: 2020 in connection_ap_handle_onion()


________________________________________________________________________________________________________
*** CID 1473232:  Control flow issues  (DEADCODE)
/src/core/or/connection_edge.c: 2020 in connection_ap_handle_onion()
2014     
2015       /* Lookup the given onion address. If invalid, stop right now.
2016        * Otherwise, we might have it in the cache or not. */
2017       unsigned int refetch_desc = 0;
2018       if (rend_cache_lookup_result < 0) {
2019         switch (-rend_cache_lookup_result) {
>>>     CID 1473232:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "case 22:".
2020         case EINVAL:
2021           /* We should already have rejected this address! */
2022           log_warn(LD_BUG,"Invalid service name '%s'",
2023                    safe_str_client(onion_address));
2024           connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
2025           return -1;
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking