summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-03-19 15:03:01 -0600
committerKarl Williamson <public@khwilliamson.com>2012-03-19 18:23:44 -0600
commitec5f19d09949aac9034bb62ade44ffba8d4d2bb1 (patch)
treeaee587b46e00f843fa393dcc6427dcbf632c1bd9 /embed.h
parentd0460f306d2b79d09a9e5694f9f72c50a2481b83 (diff)
downloadperl-ec5f19d09949aac9034bb62ade44ffba8d4d2bb1.tar.gz
utf8.c: Add utf8_to_uvchr_buf() and utf8_to_uvuni_buf()
The existing functions (utf8_to_uvchr and utf8_to_uvuni) have a deficiency in that they could read beyond the end of the input string if given malformed input. This commit creates two new functions which behave as the old ones did, but have an extra parameter each, which gives the upper limit to the string, so no read beyond it is done.
Diffstat (limited to 'embed.h')
-rw-r--r--embed.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index 1d1e598733..8a390471fd 100644
--- a/embed.h
+++ b/embed.h
@@ -672,7 +672,9 @@
#define utf8_length(a,b) Perl_utf8_length(aTHX_ a,b)
#define utf8_to_bytes(a,b) Perl_utf8_to_bytes(aTHX_ a,b)
#define utf8_to_uvchr(a,b) Perl_utf8_to_uvchr(aTHX_ a,b)
+#define utf8_to_uvchr_buf(a,b,c) Perl_utf8_to_uvchr_buf(aTHX_ a,b,c)
#define utf8_to_uvuni(a,b) Perl_utf8_to_uvuni(aTHX_ a,b)
+#define utf8_to_uvuni_buf(a,b,c) Perl_utf8_to_uvuni_buf(aTHX_ a,b,c)
#define utf8n_to_uvuni(a,b,c,d) Perl_utf8n_to_uvuni(aTHX_ a,b,c,d)
#define uvchr_to_utf8_flags(a,b,c) Perl_uvchr_to_utf8_flags(aTHX_ a,b,c)
#define uvuni_to_utf8_flags(a,b,c) Perl_uvuni_to_utf8_flags(aTHX_ a,b,c)