lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #52976] lwip_ioctl() FIONREAD crash.


From: hanhui
Subject: [lwip-devel] [bug #52976] lwip_ioctl() FIONREAD crash.
Date: Fri, 26 Jan 2018 05:21:20 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

URL:
  <http://savannah.nongnu.org/bugs/?52976>

                 Summary: lwip_ioctl() FIONREAD crash.
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: hanhui03
            Submitted on: Fri 26 Jan 2018 10:21:18 AM UTC
                Category: sockets/netconn
                Severity: 3 - Normal
              Item Group: Crash Error
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

int
lwip_ioctl(int s, long cmd, void *argp)
{
  ...
  case FIONREAD:
  ...
  /* Check if there is data left from the last recv operation. /maq 041215 */
  if (sock->lastdata.netbuf) {
    if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) {
      recv_avail += sock->lastdata.pbuf->tot_len;
    } else {
      recv_avail += sock->lastdata.netbuf->p->tot_len;
    }
  }
  should be:
  /* Check if there is data left from the last recv operation. /maq 041215 */
  if (sock->lastdata.netbuf) {
    if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) {
      recv_avail += sock->lastdata.netbuf->p->tot_len;
    } else {
      recv_avail += sock->lastdata.pbuf->tot_len;
    }
  }
  ...
}

Han.hui




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?52976>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]