Wild pointer in ipv6_get_header() and ipv4_get_header() functions

Bug #609736 reported by Didier Barvaux
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rohc
Status tracked in Rohc-main
1.2.x
Fix Released
High
Didier Barvaux
1.3.x
Fix Released
High
Didier Barvaux
Rohc-main
Invalid
Undecided
Didier Barvaux

Bug Description

When I using the ROHC code,I find a segment of code canot understanding:

struct ip6_hdr * ipv6_get_header(struct ip_packet ip)
{
 struct ip6_hdr *header;
 if(ip.version == IPV6)
  header = &ip.header.v6;
 else
  header = NULL;

 return header;
}

I think when the function end,the "ip" which used in this function(it's not the "ip" of parameter ) will be free,so the point "header" will be a wild pointer.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Problem reported in question #118413 by someone with a very strange name :)

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Confirmed in branch 1.2.x.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Confirmed in branch 1.3.x.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Main branch is not affected.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Committed in the 1.3.x branch. See http://bazaar.launchpad.net/~didier-barvaux/rohc/1.3.x/revision/150 for details.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Committed in the 1.2.x branch. See http://bazaar.launchpad.net/~didier-barvaux/rohc/1.2.x/revision/122 for details.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

The bug is now fixed in 1.2.x and 1.3.x branches. It will be released with next 1.2.3 and 1.3.2 releases. Many thanks to hzkjdxwktx that reported the bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.