Repository navigation
Commit 316bce2
committed
fix(doclinks): skip qsort on empty Perl tables; bound the Jenkins restore regex
PR #21 review follow-ups.
UBSan reported "null pointer passed as argument 1" at four qsort calls
in the Perl doc-link code that arrived with the step-6 upstream merge:
internal/cbm/doclink_perl.c (pl_number_packages twice, pl_put_subs) and
src/pipeline/doc_links_perl.c (the decl index sort). When a file has no
packages, subs or declarations, the array pointer is still NULL and the
count is 0. glibc declares qsort's base nonnull, so the call is undefined
even with a zero count. Each call now runs only when there are at least
two elements, which is also when sorting has any effect. The reports
reproduce on the pipeline and doc_mentions_perl suites before this change
and are gone after it; both suites pass. Upstream has the same code, so
this is worth sending upstream too.
tests/test_jenkins_daemon_recovery.py: a4c0a8f let the post/always
pattern skip any text before the restore sh step, so with re.S it could
match a sh step outside the always block. The gap is now limited to 200
characters without a quote, enough for the script/try wrapper that
9f26f16 added around cleanWs, so the extracted step must still be the
first sh step inside always { }.1 parent a4c0a8f commit 316bce2
3 files changed
Lines changed: 15 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1538 | 1538 | | |
1539 | 1539 | | |
1540 | 1540 | | |
1541 | | - | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
1542 | 1544 | | |
1543 | 1545 | | |
1544 | 1546 | | |
1545 | 1547 | | |
1546 | 1548 | | |
1547 | 1549 | | |
1548 | | - | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1549 | 1553 | | |
1550 | 1554 | | |
1551 | 1555 | | |
| |||
1572 | 1576 | | |
1573 | 1577 | | |
1574 | 1578 | | |
1575 | | - | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
1576 | 1582 | | |
1577 | 1583 | | |
1578 | 1584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments