encoding: prevent dereferencing of past-the-end iterator in Block::value()

If m_buffer is valid but empty, m_valueBegin is equal to m_valueEnd and
thus cannot be dereferenced. This could happen with zero-length TLVs,
e.g., if a Block is constructed with an empty buffer as TLV value.

Change-Id: I254f2d96ba250c38fd832d59e4cd5611beeda6b1
2 files changed
tree: e03e6ec4ea7b7ead1a6dd2c5764186f677a3fd6e
  1. .jenkins.d/
  2. .waf-tools/
  3. docs/
  4. examples/
  5. ndn-cxx/
  6. tests/
  7. tools/
  8. .gitignore
  9. .jenkins
  10. .mailmap
  11. .travis.yml
  12. AUTHORS.md
  13. client.conf.sample
  14. COPYING.md
  15. libndn-cxx.pc.in
  16. README-dev.md
  17. README.md
  18. waf
  19. wscript
README.md

ndn-cxx: NDN C++ library with eXperimental eXtensions

Language Build Status Latest Version

ndn-cxx is a C++14 library implementing Named Data Networking (NDN) primitives that can be used to write various NDN applications. The library is currently being used by the following projects:

Documentation

See docs/INSTALL.rst for compilation and installation instructions.

Extensive documentation is available on the library's homepage.

Reporting bugs

Please submit any bugs or feature requests to the ndn-cxx issue tracker.

Contributing

We greatly appreciate contributions to the ndn-cxx code base. If you are new to the NDN software community, please read the Contributor's Guide to get started.

License

ndn-cxx is an open source project licensed under the LGPL version 3. See COPYING.md for more information.