Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bounds checking in extension API

7 views
Skip to first unread message

Simon Glover

unread,
Oct 17, 2003, 1:42:43 PM10/17/03
to perl6-i...@perl.org

What, if any, validation of their input should the register access
functions in the extension API do? Currently, they don't do any,
which means that you can create a buffer overflow simply by using
a register number >31 or <0; eg,

Parrot_set_intreg(interpreter, 100000000, 100);

reliably segfaults on my machine. Is it the responsibility of the
extension writer to do this kind of bounds checking (in which case
we need to make this extremely plain in the documentation), or should
Parrot do this itself?

Simon

Dan Sugalski

unread,
Oct 17, 2003, 1:52:21 PM10/17/03
to Simon Glover, perl6-i...@perl.org

This ought to be done by the extension API, though it was something I
skimped on when I was throwing it together.

Dan

Simon Glover

unread,
Oct 17, 2003, 2:16:56 PM10/17/03
to Dan Sugalski, perl6-i...@perl.org

OK, so what do we do in response to an out-of-bounds access? Throw a
Parrot exception? Or indicate an error in some other fashion?

Simon

Dan Sugalski

unread,
Oct 17, 2003, 2:20:18 PM10/17/03
to Simon Glover, perl6-i...@perl.org

Throw an exception. Which, I see, there isn't a facility to do from an
extension. We need to fix that...

Dan

0 new messages