[svn:parrot] r48884 - trunk/src/string
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Thu Sep 9 16:48:49 UTC 2010
Author: NotFound
Date: Thu Sep 9 16:48:49 2010
New Revision: 48884
URL: https://trac.parrot.org/parrot/changeset/48884
Log:
avoid segfaulting in string_rep_compatible is a string has null encoding for some reason, TT #1779
Modified:
trunk/src/string/api.c
Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c Thu Sep 9 13:45:02 2010 (r48883)
+++ trunk/src/string/api.c Thu Sep 9 16:48:49 2010 (r48884)
@@ -261,6 +261,10 @@
return b->encoding;
}
+ /* Sanity check before dereferencing the encoding pointers */
+ if (a->encoding == NULL || b->encoding == NULL)
+ return NULL;
+
if (STRING_max_bytes_per_codepoint(a) != 1 ||
STRING_max_bytes_per_codepoint(b) != 1)
return NULL;
More information about the parrot-commits
mailing list