]>
Commit | Line | Data |
---|---|---|
a5c0ef36 MF |
1 | ------------------------------------------------------------ |
2 | revno: 14144 | |
3 | revision-id: squid3@treenet.co.nz-20170226084624-5tkl3bdrqz8nlp9g | |
4 | parent: squid3@treenet.co.nz-20170225055014-j7v5xax13u4jddr9 | |
5 | author: Alex Rousskov <rousskov@measurement-factory.com> | |
6 | committer: Amos Jeffries <squid3@treenet.co.nz> | |
7 | branch nick: 3.5 | |
8 | timestamp: Sun 2017-02-26 21:46:24 +1300 | |
9 | message: | |
10 | Fix crash when configuring with invalid delay_parameters restore value. | |
11 | ||
12 | ... like none/none. Introduced in rev which fixed another, much | |
13 | bigger delay_parameters parsing bug. | |
14 | ||
15 | TODO: Reject all invalid input, including restore/max of "-/100". | |
16 | ||
17 | TODO: Fix misleading/wrong associated error messages. For example: | |
18 | ERROR: invalid delay rate 'none/none'. Expecting restore/max or 'none' | |
19 | ERROR: restore rate in '1/none' is not a number. | |
20 | ------------------------------------------------------------ | |
21 | # Bazaar merge directive format 2 (Bazaar 0.90) | |
22 | # revision_id: squid3@treenet.co.nz-20170226084624-5tkl3bdrqz8nlp9g | |
23 | # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 | |
24 | # testament_sha1: 42f47b8ee1da049d57e6af76ce755e459d2fc9fd | |
25 | # timestamp: 2017-02-26 08:51:02 +0000 | |
26 | # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 | |
27 | # base_revision_id: squid3@treenet.co.nz-20170225055014-\ | |
28 | # j7v5xax13u4jddr9 | |
29 | # | |
30 | # Begin patch | |
31 | === modified file 'src/DelaySpec.cc' | |
32 | --- src/DelaySpec.cc 2017-01-01 00:16:45 +0000 | |
33 | +++ src/DelaySpec.cc 2017-02-26 08:46:24 +0000 | |
34 | @@ -55,7 +55,7 @@ | |
35 | ||
36 | // parse the first digits into restore_bps | |
37 | const char *p = NULL; | |
38 | - if (!StringToInt(token, restore_bps, &p, 10) && *p != '/') { | |
39 | + if (!StringToInt(token, restore_bps, &p, 10) || *p != '/') { | |
40 | debugs(77, DBG_CRITICAL, "ERROR: invalid delay rate '" << token << "'. Expecting restore/max or 'none'."); | |
41 | self_destruct(); | |
42 | } | |
43 |