a code question

Asked by hzkjdxwktx on 2010-07-21

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.

Question information

Language:
English Edit question
Status:
Answered
For:
rohc Edit question
Assignee:
No assignee Edit question
Last query:
2010-07-21
Last reply:
2010-07-25

Hello hzkjdxwktx,

You're right. There is a mistake in the 1.2.x and 1.3.x branches. The main branch is not affected.
Thank for pointing it. I'm going to create a bug report.

Regards,
Didier Barvaux

Can you help with this problem?

Provide an answer of your own, or ask hzkjdxwktx for more information if necessary.

To post a message you must log in.