Project

General

Profile

Actions

Bug #2552

closed

Block::fromBuffer(ConstBufferPtr, size_t, Block&) unexpected decode error

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

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Base
Target version:
Start date:
02/21/2015
Due date:
% Done:

0%

Estimated time:

Description

Snippet to reproduce:

// g++ -std=c++0x x.cpp `pkg-config --cflags --libs libndn-cxx`

#include <ndn-cxx/encoding/block.hpp>

using ndn::Buffer;
using ndn::BufferPtr;
using ndn::Block;

int
main()
{
  BufferPtr buffer = std::make_shared<Buffer>(4);
  uint8_t* buf = buffer->get();
  buf[0] = 0x01;
  buf[1] = 0x02;
  buf[2] = 0xcc;
  buf[3] = 0xdd;

  Block block1;
  Block block2;

  std::cout << Block::fromBuffer(buffer, 4, block1)
            << Block::fromBuffer(buf,    4, block2)
            << std::endl;
  return 0;
}

Expected: 11

Actual: 01


Related issues 1 (0 open1 closed)

Blocks NFD - Feature #2261: Don't use exceptions in PartialMessageStore::receiveNdnlpDataClosedJunxiao Shi

Actions
Actions

Also available in: Atom PDF