Skip to content

Commit c4dd65c

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fix buffer growth in sockets/conversion.c
2 parents eb70263 + d241711 commit c4dd65c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/sockets/conversions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,8 @@ static void from_zval_write_control(const zval *arr,
910910
if (space_left < req_space) {
911911
*control_buf = safe_erealloc(*control_buf, 2, req_space, *control_len);
912912
*control_len += 2 * req_space;
913-
memset(*control_buf, '\0', *control_len - *offset);
914-
memcpy(&alloc->data, *control_buf, sizeof *control_buf);
913+
memset(*control_buf + *offset, '\0', *control_len - *offset);
914+
memcpy(&alloc->data, control_buf, sizeof *control_buf);
915915
}
916916

917917
cmsghdr = (struct cmsghdr*)(((char*)*control_buf) + *offset);

0 commit comments

Comments
 (0)