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;
  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

English Edit question
rohc Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Didier Barvaux (didier-barvaux) said :

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.

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.