… | |
… | |
168 | /* match found at *ref++ */ |
168 | /* match found at *ref++ */ |
169 | unsigned int len = 2; |
169 | unsigned int len = 2; |
170 | unsigned int maxlen = in_end - ip - len; |
170 | unsigned int maxlen = in_end - ip - len; |
171 | maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; |
171 | maxlen = maxlen > MAX_REF ? MAX_REF : maxlen; |
172 | |
172 | |
|
|
173 | if (expect_false (op + 3 + 1 >= out_end)) /* first a faster conservative test */ |
|
|
174 | if (op - !lit + 3 + 1 >= out_end) /* second the exact but rare test */ |
|
|
175 | return 0; |
|
|
176 | |
173 | op [- lit - 1] = lit - 1; /* stop run */ |
177 | op [- lit - 1] = lit - 1; /* stop run */ |
174 | op -= !lit; /* undo run if length is zero */ |
178 | op -= !lit; /* undo run if length is zero */ |
175 | |
|
|
176 | if (expect_false (op + 3 + 1 >= out_end)) |
|
|
177 | return 0; |
|
|
178 | |
179 | |
179 | for (;;) |
180 | for (;;) |
180 | { |
181 | { |
181 | if (expect_true (maxlen > 16)) |
182 | if (expect_true (maxlen > 16)) |
182 | { |
183 | { |