Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Perl can hold a reference to a string passed to Clownfish and subsequently change the string via this reference in a callback. This violates the assumption that Clownfish strings are immutable and can lead to crashes if the string buffer is reallocated.
This scenario is somewhat contrived but for a proper fix, I think there's no other way than to always copy Perl strings passed as arguments. Fortunately, newer Perls support copy-on-write strings (default since 5.20) which makes this operation cheap.