SHA256
8
0
forked from pool/libical
Files
libical/0001-vcc.y-factor-out-hexdigit-conversion.patch
Dirk Mueller 962f39a5ac - update to 3.0.20:
* Clean up the byte-swapping macros
  * Fix a testcase in libical-glib when using 64-bit on a 32-bit
    system
- update to 3.0.19:
  * Fix for changes to the libicu 75 API
  * Add vcpkg manifest-mode support
  * Improved berkeley-db discovery on Mac with homebrew
  * Improved libicu discrovery on Mac with homebrew
  * Properly set DYLD_LIBRARY_PATH on Mac for libical-ical tests
  * Resolved known limitation: Negative values are now also
    supported for `BYMONTHDAY` and `BYYEARDAY`.
  * Add support for RDATE;VALUE=PERIOD
  * Fix time conversion to time_t for times before epoch
  * Allow `icalcomponent_foreach_recurrence` to receive
    `DATE`-only `start` and `end` params.
  * Fix the calculation of an event's duration if `DTSTART` is a
    `DATE`-only value.
  * Fix `icaltime_span_new()` - ignore the case where DTEND is
    unset and require it to be set by the caller instead.
  * Various fixes for fuzzer issues

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libical?expand=0&rev=92
2025-03-30 20:25:50 +00:00

82 lines
2.7 KiB
Diff

From 6c167138a204cd2e0580036bad32a51dae05c80b Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Mon, 17 Sep 2018 16:47:16 +0200
Subject: [PATCH 1/5] vcc.y - factor out hexdigit conversion
References: https://github.com/libical/libical/pull/354
---
src/libicalvcal/vcc.c | 17 +++++++++++------
src/libicalvcal/vcc.y | 17 +++++++++++------
2 files changed, 22 insertions(+), 12 deletions(-)
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
@@ -985,6 +985,15 @@ static int match_begin_end_name(int end)
return 0;
}
+static int hexdigit_decode(char c)
+{
+ if (c >= '0' && c <= '9')
+ return c - '0';
+ if (c >= 'A' && c <= 'F')
+ return c - 'A' + 10;
+ return -1;
+}
+
static char* lexGetQuotedPrintable(void)
{
char cur;
@@ -998,12 +1007,8 @@ static char* lexGetQuotedPrintable(void)
int next[2];
int i;
for (i = 0; i < 2; i++) {
- next[i] = lexGetc();
- if (next[i] >= '0' && next[i] <= '9')
- c = c * 16 + next[i] - '0';
- else if (next[i] >= 'A' && next[i] <= 'F')
- c = c * 16 + next[i] - 'A' + 10;
- else
+ next[i] = hexdigit_decode(lexGetc());
+ if (next[i] < 0)
break;
}
if (i == 0) {
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
@@ -949,6 +949,15 @@ static int match_begin_end_name(int end)
return 0;
}
+static int hexdigit_decode(char c)
+{
+ if (c >= '0' && c <= '9')
+ return c - '0';
+ if (c >= 'A' && c <= 'F')
+ return c - 'A' + 10;
+ return -1;
+}
+
static char* lexGetQuotedPrintable()
{
char cur;
@@ -962,12 +971,8 @@ static char* lexGetQuotedPrintable()
int next[2];
int i;
for (i = 0; i < 2; i++) {
- next[i] = lexGetc();
- if (next[i] >= '0' && next[i] <= '9')
- c = c * 16 + next[i] - '0';
- else if (next[i] >= 'A' && next[i] <= 'F')
- c = c * 16 + next[i] - 'A' + 10;
- else
+ next[i] = hexdigit_decode(lexGetc());
+ if (next[i] < 0)
break;
}
if (i == 0) {