<html>
    <head>
      <base href="https://bugzilla.netfilter.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:jeremy@azazel.net" title="Jeremy Sowden <jeremy@azazel.net>"> <span class="fn">Jeremy Sowden</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - mnl_nlmsg_ok returns true on malformed/incomplete messages leading to potential runtime issues"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1691">bug 1691</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>ASSIGNED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>jeremy@azazel.net
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Assignee</td>
           <td>pablo@netfilter.org
           </td>
           <td>jeremy@azazel.net
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - mnl_nlmsg_ok returns true on malformed/incomplete messages leading to potential runtime issues"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1691#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED - mnl_nlmsg_ok returns true on malformed/incomplete messages leading to potential runtime issues"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1691">bug 1691</a>
              from <span class="vcard"><a class="email" href="mailto:jeremy@azazel.net" title="Jeremy Sowden <jeremy@azazel.net>"> <span class="fn">Jeremy Sowden</span></a>
</span></b>
        <pre>My preference would be to get rid of the casts altogether:

EXPORT_SYMBOL bool mnl_nlmsg_ok(const struct nlmsghdr *nlh, int len)
{
    size_t ulen = len;

    if (len < 0)
        return 0;

    return ulen           >= sizeof(struct nlmsghdr) &&
           nlh->nlmsg_len >= sizeof(struct nlmsghdr) &&
           nlh->nlmsg_len <= ulen;
}

I will send a patch.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>