api.h, api_lib.c, sockets.c: netbuf_ref doesn't check its internal pbuf_alloc call result and can cause a crash. lwip_send now check netbuf_ref result.

This commit is contained in:
fbernon
2007-03-28 17:26:06 +00:00
parent d956a39fec
commit 913a99dd35
4 changed files with 24 additions and 23 deletions

View File

@@ -82,7 +82,6 @@ struct netbuf {
struct pbuf *p, *ptr;
struct ip_addr *fromaddr;
u16_t fromport;
err_t err;
};
struct netconn {
@@ -111,7 +110,7 @@ struct netbuf * netbuf_new (void);
void netbuf_delete (struct netbuf *buf);
void * netbuf_alloc (struct netbuf *buf, u16_t size);
void netbuf_free (struct netbuf *buf);
void netbuf_ref (struct netbuf *buf,
err_t netbuf_ref (struct netbuf *buf,
const void *dataptr, u16_t size);
void netbuf_chain (struct netbuf *head,
struct netbuf *tail);