Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #10536

Closed (moved)
Open
Opened Jan 02, 2014 by cypherpunks@cypherpunks

extend_cell_parse: don't try to parse payload if zero length

If payload length for EXTEND2 cell is zero then extend_cell_parse() still tries to parse it by:

uint8_t n_specs = *payload

This bug should be harmless as

 if (eop - payload < 2)

still true.

Fixed code should be looking like:

uint8_t n_specs = 0;
...
if (eop - payload > 0)
  ++payload;
...

or

uint8_t n_specs;
...
if (eop - payload < 1)
  return -1;
cell_out->cell_type = RELAY_COMMAND_EXTEND2;
++payload;

or like dropping cell for any cell type if zero length.

int
extend_cell_parse(extend_cell_t *cell_out, const uint8_t command,
                  const uint8_t *payload, size_t payload_length)
{
  const uint8_t *eop;

  memset(cell_out, 0, sizeof(*cell_out));
  if (payload_length > RELAY_PAYLOAD_SIZE || 0 == payload_length)
    return -1;

or something.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.2.5.x-final
Milestone
Tor: 0.2.5.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#10536