From bf83a0d664f46229836852f5b41539c263c3b921 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 17 Sep 2018 16:36:36 +0200 Subject: [PATCH 2/5] vcc.y - fix infinite loop with lower-case hex digits References: https://github.com/libical/libical/pull/354 When lower-case hex digits are used in a quoted-printable-encoded character, an infinite loop would occur in the vcard parser. "N;ENCODING=QUOTED-PRINTABLE:=c3=a4=c3=b6;=c3=bC=c3=9f\n" References: #353 --- src/libicalvcal/vcc.c | 2 ++ src/libicalvcal/vcc.y | 2 ++ 2 files changed, 4 insertions(+) Index: libical-3.0.17/src/libicalvcal/vcc.c =================================================================== --- libical-3.0.17.orig/src/libicalvcal/vcc.c +++ libical-3.0.17/src/libicalvcal/vcc.c @@ -991,6 +991,8 @@ static int hexdigit_decode(char c) return c - '0'; if (c >= 'A' && c <= 'F') return c - 'A' + 10; + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; return -1; } Index: libical-3.0.17/src/libicalvcal/vcc.y =================================================================== --- libical-3.0.17.orig/src/libicalvcal/vcc.y +++ libical-3.0.17/src/libicalvcal/vcc.y @@ -955,6 +955,8 @@ static int hexdigit_decode(char c) return c - '0'; if (c >= 'A' && c <= 'F') return c - 'A' + 10; + if (c >= 'a' && c <= 'f') + return c - 'a' + 10; return -1; }