summaryrefslogtreecommitdiff
path: root/utils/idna.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/idna.c')
-rw-r--r--utils/idna.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/idna.c b/utils/idna.c
index 70d321db5..d657f90e2 100644
--- a/utils/idna.c
+++ b/utils/idna.c
@@ -437,7 +437,7 @@ static bool idna__is_valid(int32_t *label, size_t len)
*/
/* 2. Check characters 3 and 4 are not '--'. */
- if ((label[2] == 0x002d) && (label[3] == 0x002d)) {
+ if ((len >= 4) && (label[2] == 0x002d) && (label[3] == 0x002d)) {
NSLOG(netsurf, INFO,
"Check failed: characters 2 and 3 are '--'");
return false;