OSSP CVS Repository

ossp - Ticket #61 History
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [View

Ticket 61 History: xdr_decode_string does not zero-terminate the resulting string

  1. Created 2005-May-31 15:06:27 by anonymous
  2. Added remarks:
    2005-May-31 15:08:15 by anonymous:
    I didn't find any "attach" function so I provide the patch here:

    --- xds-0.9.1/xds_engine_xdr.c  2004-09-12 19:24:34.000000000 +0200
    +++ xds-0.9.1-patched/xds_engine_xdr.c  2005-05-31 14:30:06.388110990 +0200
    @@ -696,7 +696,7 @@
    
         /* Copy data into the buffer. */
         memmove(*p, (xds_uint8_t *)buffer + 4, p_len);
    -    ((xds_uint8_t *)buffer)[4 + p_len] = '\0';
    +    ((xds_uint8_t *)*p)[p_len] = '\0';
    
         return XDS_OK;
     }
    
    by anonymous on 2005-May-31 15:08
  3. Appended to remarks:

    2005-May-31 15:17:47 by anonymous:
    Simpler patch:

    --- xds-0.9.1/xds_engine_xdr.c  2004-09-12 19:24:34.000000000 +0200
    +++ xds-0.9.1-patched/xds_engine_xdr.c  2005-05-31 15:15:07.550781769 +0200
    @@ -696,7 +696,7 @@
    
         /* Copy data into the buffer. */
         memmove(*p, (xds_uint8_t *)buffer + 4, p_len);
    -    ((xds_uint8_t *)buffer)[4 + p_len] = '\0';
    +    (*p)[p_len] = '\0';
    
         return XDS_OK;
     }
    
    by anonymous on 2005-May-31 15:17
  4. Check-in [5082]: Fix XDR string decoding function by NUL terminating the target buffer (instead of the source buffer). Submitted by: Unknown <ossp@jm.2good.nu>(By rse on 2005-Jun-02 20:43)
  5. Change status from "new" to "fixed" by rse on 2005-Jun-02 20:43

CVSTrac 2.0.1