Projects
openEuler:24.03:SP1:Everything
libical
_service:tar_scm:libical-bugfix-timeout-found-b...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:libical-bugfix-timeout-found-by-fuzzer.patch of Package libical
From 3eacf85ec9dd638c2023c89c2a6cdf61107fc617 Mon Sep 17 00:00:00 2001 From: Kent Sutherland <git@ksuther.com> Date: Fri, 14 Jun 2019 15:21:59 -0500 Subject: [PATCH] Fix timeout found by fuzzer (oss-fuzz issue 14881) strspn is really slow compared to doing direct comparisons --- src/libical/icalparser.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/libical/icalparser.c b/src/libical/icalparser.c index fa92495..0530a4b 100644 --- a/src/libical/icalparser.c +++ b/src/libical/icalparser.c @@ -221,21 +221,29 @@ static void parser_decode_param_value(char *value) char *in, *out; for (in = out = value; *in; in++, out++) { - if (*in == '^' && strspn(in+1, "n^'")) { - switch (*++in) { - case 'n': + int found_escaped_char = 0; + + if(*in == '^'){ + switch (*(in + 1)) { + case 'n': *out = '\n'; + found_escaped_char = 1; break; - case '^': *out = '^'; + found_escaped_char = 1; break; case '\'': *out = '"'; + found_escaped_char = 1; break; } - } else { + } + + if(found_escaped_char) { + ++in; + } else { *out = *in; } } -- 2.19.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2