buglwIP - A Lightweight TCP/IP stack - Bugs: bug #63929, ip6_frag.c: suspicious usage of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #63929: ip6_frag.c: suspicious usage of 'sizeof(A*)'; pointer to aggregate

Submitter:  Jarno Malmari <jmalmari>
Submitted:  Wed 15 Mar 2023 09:24:39 AM UTC
   
 
Category:  IPv6 Severity:  3 - Normal
Item Group:  Compiler Warning Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  git head

Wed 15 Mar 2023 09:24:39 AM UTC, original submission:  

clang-tidy found this potential issue. Can someone confirm if the sizeof argument is intentional? In the following snippet, I am talking about the last line with sizeof(iprh).


  struct ip6_reass_helper *iprh;

#if LWIP_ICMP6
  iprh = (struct ip6_reass_helper *)ipr->p->payload;
  if (iprh->start == 0) {
    /* The first fragment was received, send ICMP time exceeded. */
    /* First, de-queue the first pbuf from r->p. */
    p = ipr->p;
    ipr->p = iprh->next_pbuf;
    /* Restore the part that we've overwritten with our helper structure, or we
     * might send garbage (and disclose a pointer) in the ICMPv6 reply. */
    MEMCPY(p->payload, ipr->orig_hdr, sizeof(iprh));


Should it be sizeof(*iprh) or some symbolic constant?

I'm using the latest master branch 3fe8d2fc43a9b69f7ed28c63d44a7744f9c0def9.

Jarno Malmari <jmalmari>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jmalmari (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.12