Project

General

Profile

Actions

Bug #2729

closed

Block::fromStream decode error when TLV-LENGTH equals zero

Added by Junxiao Shi over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base
Target version:
Start date:
04/04/2015
Due date:
% Done:

100%

Estimated time:
0.50 h

Description

Snippet to reproduce:

  uint8_t BUFFER[] = { 0x07, 0x00 };

  std::stringstream stream;
  stream.write(reinterpret_cast<const char*>(BUFFER), sizeof(BUFFER));
  stream.seekg(0);

  Block::fromStream(stream);

Expected: no error

Actual: "Not enough data in the buffer to fully parse TLV"


Related issues 1 (0 open1 closed)

Related to ndn-cxx - Bug #4180: Block::fromStream consumes extra octet when TLV-LENGTH equals zeroClosedJunxiao Shi07/10/2017

Actions
Actions #1

Updated by Junxiao Shi over 9 years ago

  • Status changed from New to In Progress
  • Assignee set to Junxiao Shi

Solution: don't read from iterator if length equals zero

Actions #2

Updated by Junxiao Shi over 9 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #3

Updated by Junxiao Shi over 9 years ago

  • Status changed from Code review to Closed
Actions #4

Updated by Junxiao Shi over 7 years ago

  • Related to Bug #4180: Block::fromStream consumes extra octet when TLV-LENGTH equals zero added
Actions

Also available in: Atom PDF