]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/squid/0003-ESI-make-sure-endofName-never-exceeds-tagEnd-130.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / squid / 0003-ESI-make-sure-endofName-never-exceeds-tagEnd-130.patch
1 From eb2db98a676321b814fc4a51c4fb7928a8bb45d9 Mon Sep 17 00:00:00 2001
2 From: Amos Jeffries <yadij@users.noreply.github.com>
3 Date: Fri, 19 Jan 2018 13:54:14 +1300
4 Subject: [PATCH] ESI: make sure endofName never exceeds tagEnd (#130)
5
6 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
7 ---
8  src/esi/CustomParser.cc | 4 ++--
9  1 file changed, 2 insertions(+), 2 deletions(-)
10
11 diff --git a/src/esi/CustomParser.cc b/src/esi/CustomParser.cc
12 index d86d2d309..db634d921 100644
13 --- a/src/esi/CustomParser.cc
14 +++ b/src/esi/CustomParser.cc
15 @@ -121,7 +121,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool
16  
17              char * endofName = strpbrk(const_cast<char *>(tag), w_space);
18  
19 -            if (endofName > tagEnd)
20 +            if (!endofName || endofName > tagEnd)
21                  endofName = const_cast<char *>(tagEnd);
22  
23              *endofName = '\0';
24 @@ -214,7 +214,7 @@ ESICustomParser::parse(char const *dataToParse, size_t const lengthOfData, bool
25  
26              char * endofName = strpbrk(const_cast<char *>(tag), w_space);
27  
28 -            if (endofName > tagEnd)
29 +            if (!endofName || endofName > tagEnd)
30                  endofName = const_cast<char *>(tagEnd);
31  
32              *endofName = '\0';
33 -- 
34 2.11.0
35