]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/squid/SQUID-2018_1.patch
9392219a9edc8c463c2ef670d97176cc36e75752
[people/pmueller/ipfire-2.x.git] / src / patches / squid / SQUID-2018_1.patch
1 commit eb2db98a676321b814fc4a51c4fb7928a8bb45d9 (refs/remotes/origin/v3.5)
2 Author: Amos Jeffries <yadij@users.noreply.github.com>
3 Date: 2018-01-19 13:54:14 +1300
4
5 ESI: make sure endofName never exceeds tagEnd (#130)
6
7 diff --git a/src/esi/CustomParser.cc b/src/esi/CustomParser.cc
8 index d86d2d3..db634d9 100644
9 --- a/src/esi/CustomParser.cc
10 +++ b/src/esi/CustomParser.cc
11 @@ -121,7 +121,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool
12
13 char * endofName = strpbrk(const_cast<char *>(tag), w_space);
14
15 - if (endofName > tagEnd)
16 + if (!endofName || endofName > tagEnd)
17 endofName = const_cast<char *>(tagEnd);
18
19 *endofName = '\0';
20 @@ -214,7 +214,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool
21
22 char * endofName = strpbrk(const_cast<char *>(tag), w_space);
23
24 - if (endofName > tagEnd)
25 + if (!endofName || endofName > tagEnd)
26 endofName = const_cast<char *>(tagEnd);
27
28 *endofName = '\0';