1 Star 0 Fork 12

chengquan/libidn

forked from src-openEuler/libidn 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-Fix-build-failure-in-csharp.patch 2.55 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 22:56 +08:00 . Package init
From fc03b00ddf68ef2075aa56dbaa0d1bbb19c5f7e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
Date: Fri, 24 May 2019 13:03:11 +0200
Subject: Fix build failure in csharp/
---
csharp/Makefile.am | 6 +++---
lib/punycode.c | 7 +++++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/csharp/Makefile.am b/csharp/Makefile.am
index 7afdea9..4625738 100644
--- a/csharp/Makefile.am
+++ b/csharp/Makefile.am
@@ -59,15 +59,15 @@ GenerateTables.exe: $(SOURCES_GENERATE)
`for src in $(SOURCES_GENERATE); do echo $(srcdir)/$$src; done`
if ! test -f rfc3454.txt; then \
ln -s $(SPEC)/rfc3454.txt . \
- || cp $(SPEC)/rfc3454.txt .; \
+ || cp $(SPEC)/rfc3454.txt . || true; \
fi
if ! test -f UnicodeData.txt; then \
ln -s $(SPEC)/UnicodeData-3.2.0.txt UnicodeData.txt \
- || cp $(SPEC)/UnicodeData-3.2.0.txt UnicodeData.txt; \
+ || cp $(SPEC)/UnicodeData-3.2.0.txt UnicodeData.txt || true; \
fi
if ! test -f CompositionExclusions.txt; then \
ln -s $(SPEC)/CompositionExclusions-3.2.0.txt CompositionExclusions.txt \
- || cp $(SPEC)/CompositionExclusions-3.2.0.txt CompositionExclusions.txt; \
+ || cp $(SPEC)/CompositionExclusions-3.2.0.txt CompositionExclusions.txt || true; \
fi
RFC3454.cs CombiningClass.cs DecompositionKeys.cs DecompositionMappings.cs Composition.cs: $(GEN_SOURCES)
diff --git a/lib/punycode.c b/lib/punycode.c
index f7c63e6..bb5f34b 100644
--- a/lib/punycode.c
+++ b/lib/punycode.c
@@ -228,7 +228,7 @@ punycode_encode (size_t input_length,
output[out++] = case_flags ?
encode_basic (input[j], case_flags[j]) : (char) input[j];
}
- else if (input[j] > 0x10FFFF)
+ else if (input[j] > 0x10FFFF || (input[j] >= 0xD800 && input[j] <= 0xDBFF))
return punycode_bad_input;
/* else if (input[j] < n) return punycode_bad_input; */
/* (not needed for Punycode with unsigned code points) */
@@ -378,6 +378,9 @@ punycode_decode (size_t input_length,
return punycode_bad_input;
output[out++] = input[j];
}
+ for (j = b + (b > 0); j < input_length; ++j)
+ if (!basic (input[j]))
+ return punycode_bad_input;
/* Main decoding loop: Start just after the last delimiter if any */
/* basic code points were copied; start at the beginning otherwise. */
@@ -420,7 +423,7 @@ punycode_decode (size_t input_length,
if (i / (out + 1) > maxint - n)
return punycode_overflow;
n += i / (out + 1);
- if (n > 0x10FFFF)
+ if (n > 0x10FFFF || (n >= 0xD800 && n <= 0xDBFF))
return punycode_bad_input;
i %= (out + 1);
--
cgit v1.0-41-gc330
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengquanspace/libidn.git
git@gitee.com:chengquanspace/libidn.git
chengquanspace
libidn
libidn
master

搜索帮助