memcpy error in Jardin for MT DGRAM servers

Bug #494238 reported by Aleksander Morgado
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
El Jardin
Fix Released
Medium
Aleksander Morgado

Bug Description

Found a memcpy error when duplicating a connection module inside jardin (line 332, jardin_connection_module.c):

        /* Duplicate buffer contents only if there is something to duplicate.
         * When the dup() is used after an ACCEPT in STREAM protocol, this
         * buffer will be empty. If it is used after a RECV in DGRAM protocol
         * for MT enabled servers, it will contain the datagram to process */
        if(priv->_reception_buffer_current_size > 0)
        {
            memcpy(&(priv_new->_reception_buffer[0]),
                   &(priv_new->_reception_buffer[0]),
                   priv->_reception_buffer_current_size);
            priv_new->_reception_buffer_current_size = priv->_reception_buffer_current_size;
        }

Should be:
            memcpy(&(priv_new->_reception_buffer[0]),
                   &(priv->_reception_buffer[0]),
                   priv->_reception_buffer_current_size);

This code is only executed for Multi-Threaded DGRAM servers...

Changed in eljardin:
status: New → Confirmed
importance: Undecided → Medium
Changed in eljardin:
assignee: nobody → Aleksander Morgado (aleksander-m)
Changed in eljardin:
milestone: none → 2.0.2003
status: Confirmed → Fix Committed
Changed in eljardin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.