[Pidgin] #9931: Improper use of Purple::XMLNode:to_str leads to crash of pidgin

Pidgin trac at pidgin.im
Mon Aug 17 13:52:12 EDT 2009


#9931: Improper use of Purple::XMLNode:to_str leads to crash of pidgin
--------------------+-------------------------------------------------------
 Reporter:  mcepl   |        Owner:  deryni   
     Type:  defect  |       Status:  pending  
Milestone:          |    Component:  libpurple
  Version:          |   Resolution:           
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by deryni):

 Purple::XMLNode->from_str($packetstr, -1); probably, I don't think calling
 with :: passes the class as the first argument. I'm not sure why from_str
 takes the class as the first argument you can't meaningfully call it on an
 xmlnode object anyway, that's probably an API bug.

 I'm not sure there's anything we can do about preventing this sort of
 crash, I'm not even sure what caused the crash, unless $packet was undef
 at that point in which case I'd have hoped that the XS stuff would have
 screamed at you about passing an invalidly typed variable to from_str (hm,
 looking at the generated C code it doesn't seem to check the arguments at
 all, and doesn't even look at the first argument), so I'm back to not
 knowing why it crashed.

 Wait a second, that backtrace is crashing in xmlnode_to_str_helper. Did
 you call to_str instead of from_str by accident? (The perl API exposed
 to_str is broken, it shouldn't take a length argument as perl strings
 carry their length around with them.) I'm still not sure there's anything
 we can do to prevent this crash, bogus data is bogus data.

-- 
Ticket URL: <http://developer.pidgin.im/ticket/9931#comment:4>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list