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

PMC Creation Functions Can Cause Segfaults #292

Open
chromatic opened this issue Sep 24, 2010 · 1 comment
Open

PMC Creation Functions Can Cause Segfaults #292

chromatic opened this issue Sep 24, 2010 · 1 comment

Comments

@chromatic
Copy link
Contributor

The exported Parrot_pmc_new(), Parrot_pmc_new_noinit(), Parrot_pmc_new_init(), Parrot_pmc_new_init_int(), Parrot_pmc_new_constant_noinit(), Parrot_pmc_new_constant(), Parrot_pmc_new_constant_init(), and Parrot_pmc_new_constant_init() functions all take an INTVAL base_type parameter. The functions use this parameter as an index into the given interpreter's vtable array to determine which PMC to create.

These functions perform no appropriate checking to determine if the base_type is positive or within the appropriate range of values for the known vtable types. Any extension could crash Parrot by passing in an invalid value.

We should consider changing the type of the base_type to UINTVAL, but we should also perform bounds checking against interp->n_vtable_alloced in all of these functions (probably with a static function).

Originally http://trac.parrot.org/parrot/ticket/1802

@ghost ghost assigned Whiteknight May 9, 2012
@leto
Copy link
Member

leto commented Dec 12, 2012

Any updates on this issue? Does it include writing tests as well as changing the implementation?

@Whiteknight Whiteknight removed their assignment Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants