]> granicus.if.org Git - php/commitdiff
Ensure memory is initialized
authorGustavo Lopes <glopes@nebm.ist.utl.pt>
Thu, 31 Jan 2013 14:25:55 +0000 (15:25 +0100)
committerGustavo Lopes <glopes@nebm.ist.utl.pt>
Sat, 2 Feb 2013 15:38:08 +0000 (16:38 +0100)
ext/sockets/conversions.c

index ef1f884210af8d121e624d92671b4998ebbe4ccb..d0d0c4b798651fc3aa1fbac66e0905bd456c341b 100644 (file)
@@ -858,6 +858,7 @@ static void from_zval_write_control(const zval                      *arr,
        if (space_left < req_space) {
                *control_buf = safe_erealloc(*control_buf, 2, req_space, *control_len);
                *control_len += 2 * req_space;
+               memset(*control_buf, '\0', *control_len - *offset);
                memcpy(&alloc->data, *control_buf, sizeof *control_buf);
        }