You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/08/10 19:24:00 UTC
[lucy-commits] svn commit: r1156269 - /incubator/lucy/trunk/core/Lucy/Object/CharBuf.c
Author: marvin
Date: Wed Aug 10 17:24:00 2011
New Revision: 1156269
URL: http://svn.apache.org/viewvc?rev=1156269&view=rev
Log:
Don't ignore the return value of a UTF-8 validity check.
Modified:
incubator/lucy/trunk/core/Lucy/Object/CharBuf.c
Modified: incubator/lucy/trunk/core/Lucy/Object/CharBuf.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/CharBuf.c?rev=1156269&r1=1156268&r2=1156269&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/CharBuf.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/CharBuf.c Wed Aug 10 17:24:00 2011
@@ -108,7 +108,9 @@ CB_new_steal_from_trusted_str(char *ptr,
CharBuf*
CB_new_steal_str(char *ptr, size_t size, size_t cap) {
- StrHelp_utf8_valid(ptr, size);
+ if (!StrHelp_utf8_valid(ptr, size)) {
+ DIE_INVALID_UTF8(ptr, size);
+ }
return CB_new_steal_from_trusted_str(ptr, size, cap);
}