Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
wireshark
wireshark
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 1,307
    • Issues 1,307
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 89
    • Merge Requests 89
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Wireshark Foundation
  • wiresharkwireshark
  • Issues
  • #16988

Closed
Open
Opened Nov 04, 2020 by huangqiangxiong@huangqiangxiongContributor

Protobuf: failed to parse .proto file contains negative enum values or option values of number type

Summary

Wireshark failed to load a '.proto' file contains negative enum values or option values of number type.

Steps to reproduce

Put the file test_default_value.proto in one of the 'Protobuf search paths' in Protobuf protocol preferences, and make this path 'load all files' option on. Then open any Protobuf capture file, you will get the syntax error about parsing .proto file.

You can open this capture protobuf_test_default_value.pcapng. Make sure to add UDP port 8128 and wireshark.protobuf.test.TestDefaultValueMessage to your 'Protobuf UDP Message Types' table in preferences.

What is the current bug behavior?

If a '.proto' file contains negative enum values or option values of number type in your 'Protobuf search paths', when you open any Protobuf related capture file, Wireshark will popup am Error dialog complain the syntax error in that .proto file.

Following describe where errors occur.

syntax = "proto2";
package wireshark.protobuf.test;

message TestDefaultValueMessage {
  enum EnumFoo {
    ENUM_FOO_V_FIRST = 1;
    ENUM_FOO_V_SECOND = 0x2;
    ENUM_FOO_V_THIRD = 3;
    ENUM_FOO_V_FOURTH = - 4;  // Wireshark protobuf dissector report error because of -4.
  }
...
  required int32 int32WithValue_8 = 1 [ default = 2 ]; // Wireshark report error because of 2.
...

What is the expected correct behavior?

test_default_value.proto is a valid .proto file (in 'proto2' syntax). Wireshark protobuf dissector should not report error.

Sample capture file

  • test_default_value.proto - example .proto file.
  • protobuf_test_default_value.pcapng - sample capture.

Relevant logs and/or screenshots

(Paste any relevant logs)

Build information

3.4.0
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: wireshark/wireshark#16988