Skip to content

dnslabeltext.rl assumes labellen is signed #10404

Description

@zeha
  • Program: dnsdist (affected code is shared though)
  • Issue type: Bug report

Short description

dnslabeltext.rl: In function ‘DNSName::string_t segmentDNSNameRaw(const char*, size_t)’:
dnslabeltext.rl:115:38: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  115 |                         if (labellen < 0 || labellen > 63) {
      |                             ~~~~~~~~~^~~
dnslabeltext.rl:115:38: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  115 |                         if (labellen < 0 || labellen > 63) {
      |                             ~~~~~~~~~^~~

labeltext is defined as char, but some platforms have char as unsigned.

I cannot tell if this is harmless or not.

Environment

  • Operating system: Debian bullseye (testing) arm64, ppc64el, s390x
  • Software version: 1.6.0
  • Software source: source tarball

Steps to reproduce

Build on arm64 / ppc64el / s390x, apparently :)

Other information

Logs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions