From: Ruslan Kuprieiev Date: Thu, 15 Jun 2017 23:34:22 +0000 (+0300) Subject: unicode: use OnigCtype in onigenc_unicode_ctype_code_range argument X-Git-Tag: v6.4.0~2^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=386e19b8f4f262c78203a6f3af7bbc1a478bf6ef;p=onig unicode: use OnigCtype in onigenc_unicode_ctype_code_range argument Array index 'ctype' is of type 'int' and is not checked for being < 0. Id: 23, 21 Signed-off-by: Ruslan Kuprieiev --- diff --git a/src/regenc.h b/src/regenc.h index e119dab..64209fc 100644 --- a/src/regenc.h +++ b/src/regenc.h @@ -154,7 +154,7 @@ ONIG_EXTERN struct PropertyNameCtype* sjis_lookup_property_name P_((register con /* in enc/unicode.c */ ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype)); ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[])); -ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((int ctype, const OnigCodePoint* ranges[])); +ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((OnigCtype ctype, const OnigCodePoint* ranges[])); ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_((OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[])); ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold)); ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg)); diff --git a/src/unicode.c b/src/unicode.c index 8812ca2..654b2b0 100644 --- a/src/unicode.c +++ b/src/unicode.c @@ -162,7 +162,7 @@ onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype) extern int -onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[]) +onigenc_unicode_ctype_code_range(OnigCtype ctype, const OnigCodePoint* ranges[]) { if (ctype >= CODE_RANGES_NUM) { int index = ctype - CODE_RANGES_NUM;