Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed possible segfault in swoole_table #117

Merged
merged 1 commit into from
Sep 23, 2014

Conversation

bixuehujin
Copy link
Member

The memory_size in swTable_create should be:

size_t memory_size = (row_num * row_memory_size) + (table->size * sizeof(swTableRow *))  + sizeof(swMemoryPool) + sizeof(swFixedPool) + ((row_num - table->size) * sizeof(swFixedPool_slice));

otherwise, swFixedPool_init() may override not allocated memory and cause segfault.

matyhtf added a commit that referenced this pull request Sep 23, 2014
Fixed possible segfault in swoole_table
@matyhtf matyhtf merged commit e7488a1 into swoole:master Sep 23, 2014
@bixuehujin bixuehujin deleted the fix-table-segfault branch September 23, 2014 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants