Ticket #94 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

"edit_line 33" segfaults

Reported by: zimbatm Owned by:
Milestone: Keywords:
Cc:

Description

!ruby
Shoes.app do
  edit_line 33
end

Change History

Changed 7 months ago by harold

Avast!

The (scary long) SETUP_CONTROL macro is making a dangerous assumption.

...
text = ATTR(self_t->attr, text); \
if (!NIL_P(text)) { \
  msg = RSTRING_PTR(text); \
  len = (RSTRING_LEN(text) * 6) + 32; \
} \
...

Yup, if there's an ATTR there, lets just assume it's a string. "Hey Ruby! What's that string?" ... "--> Boom?!"

Someone more up on their Ruby C API could probably write some code that tests to see if it's really a string, and if not, go ahead an call to_s on it or something.

Hope that helps.

Oh, as a workaround, you could call to_s yourself. :P

Changed 7 months ago by why

  • status changed from new to closed
  • resolution set to fixed

Okay. [420]

Note: See TracTickets for help on using tickets.