You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucy.apache.org by "Nick Wellnhofer (JIRA)" <ji...@apache.org> on 2015/05/16 18:52:59 UTC
[lucy-issues] [jira] [Created] (CLOWNFISH-44) Immutable Strings can be changed
from Perl
Nick Wellnhofer created CLOWNFISH-44:
----------------------------------------
Summary: Immutable Strings can be changed from Perl
Key: CLOWNFISH-44
URL: https://issues.apache.org/jira/browse/CLOWNFISH-44
Project: Apache Lucy-Clownfish
Issue Type: Bug
Components: Perl
Reporter: Nick Wellnhofer
Priority: Minor
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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)