1. ignitionrobotics
  2. Ignition
  3. ign-transport
  4. Pull requests

Pull requests

#142 Merged at 75c1fc2
Repository
nampi
Branch
issue_43_v2
Repository
ignitionrobotics
Branch
default

Restrict a topic length

Author
  1. nampi
Reviewers
Description

We want to restrict the maximum topic length. Right now, the topic length field is a uint64_t, allowing a really huge string with its potential security risks. We can change uint64_t to a uint16_t. On the one hand, uint16_t is not very big and it forbids to have very long topic. On other hand, uint16_t is not very small and it allows to have enough space for any potential topic value.

  • Changing uint64_t to a uint16_t.
  • Adding tests for Publisher::MsgLength() method.
  • Updating Discovery.hh::kWireVersion.
  • Adding TopicUtils::kMaxNameLength = 65535. The kMaxNameLength specifies the maximum number of characters allowed in a namespace, a partition name, a topic name, and a fully qualified topic name.
  • Minor edits in error messages (Topic -> Service).

Comments (10)

  1. Carlos Agüero

    How about the code to guarantee that a topic always fit in a size16_t variable? I'm thinking on a check in TopicUtils::FullyQualifiedName() with its own test. The max size should be now 65535. The result of FullyQualifiedName() is the topic that we use to create a Publisher object.