Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • wireshark wireshark
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 1,350
    • Issues 1,350
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 183
    • Merge requests 183
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Wireshark FoundationWireshark Foundation
  • wiresharkwireshark
  • Issues
  • #18517
Closed
Open
Issue created Oct 20, 2022 by Zhao Ziqing@zzqcn

Wrong pointer conversion in get_data_source_tvb_by_name()

Summary

There is a wrong pointer conversion in get_data_source_tvb_by_name(). data_source pointer should be retrived from source->data rather than source itself. See below

// in epan/packet.c
tvbuff_t *
get_data_source_tvb_by_name(packet_info *pinfo, const char *name)
{
	GSList *source;
	for (source = pinfo->data_src; source; source = source->next) {
		struct data_source *this_source = (struct data_source *)source; // should be (struct data_source *)source->data
		if (this_source->name && strcmp(this_source->name, name) == 0) {
			return this_source->tvb;
		}
	}
	return NULL;
}

Steps to reproduce

I write a dissector plugin and call get_data_source_tvb_by_name(pinfo, "Reassembled TCP"); in dissect function, and find it can't get correct tvb. After I change code like above this fuction return correct tvb.

Build information

  • OS: Windows 11
  • IDE: Visual Studio 2019
  • Wireshark: 4.0.0 (newer version has this issue too)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking