buglwIP - A Lightweight TCP/IP stack - Bugs: bug #2943, netconn_peer(): checking...

 
 

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

bug #2943: netconn_peer(): checking uninitialized udp pcb

Submitted by:  Donald Vlahovic <duck71>
Submitted on:  Wed 26 Mar 2003 02:34:05 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None
lwIP version: None

Wed 26 Mar 2003 02:34:05 PM UTC, original submission:

There is a bug in netconn_peer():

When calling lwip_socket() in an application a netconnection is created and conn->pcb.tcp is set to NULL.

In next step the application calls lwip_sendto() which checks in netconn_peer() if the PCB is connected. For UDP the flag UDP_FLAGS_CONNECTED in conn->pcb.udp->flags is checked. Now when the connection is new and conn->pcb.tcp is NULL, the UDP PCB is not initialized, but ERR_OK is returned under some circumstances so lwip_sendto() sets connected to 1.

To prevent this we could check if conn->pcb.tcp is NULL before processing the switch command and return -1 in this case:

err_t
netconn_peer(struct netconn conn, struct ip_addr addr,
u16_t *port)
{
if(conn->pcb.tcp == NULL)
return -1;

switch(conn->type) {
...

Donald Vlahovic <duck71>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 28 Mar 2003 02:39:06 PM UTCkieranmStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1