CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

BUGFIX - Possible double free if msg ID differs from expected. #188

Closed andre-d-brizido-alb closed 8 years ago

andre-d-brizido-alb commented 8 years ago

In nc_session_send_recv the reply should not be returned if it's going to be inserted in the queue.

andre-d-brizido-alb commented 8 years ago

In session.c in the nc_session_send_recv function, if the final outcome is unknown or none, a message received with a different message ID of the one desired may be returned to the caller after being inserted into the session's queue. The caller of nc_session_send_recv function can then free that message leaving an invalid reference in the queue.