Commit 7e4ada0
committed
receive-pack: fix crash on out-of-namespace symref
`check_aliased_update_internal()` detects when a symbolic ref and its
target are being updated in the same push. It does this by building a
list of ref names without the optional namespace prefix. When a symbolic
ref within a namespace points to a ref outside the namespace,
`strip_namespace()` returns NULL which leads to a segfault.
A NULL check preventing this particular issue was repurposed in
ded8393. Rather than reintroducing it, we can instead build a list of
fully qualified ref names. This prevents the crash, preserves the
consistency check from da3efdb, and allows updates to all symbolic
refs.
Signed-off-by: Troels Thomsen <troels@thomsen.io>1 parent 66ce5f8 commit 7e4ada0
2 files changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1685 | 1685 | | |
1686 | 1686 | | |
1687 | 1687 | | |
1688 | | - | |
1689 | 1688 | | |
1690 | 1689 | | |
1691 | 1690 | | |
| |||
1730 | 1729 | | |
1731 | 1730 | | |
1732 | 1731 | | |
| 1732 | + | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
1736 | | - | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
1737 | 1739 | | |
1738 | 1740 | | |
1739 | 1741 | | |
| |||
1743 | 1745 | | |
1744 | 1746 | | |
1745 | 1747 | | |
| 1748 | + | |
1746 | 1749 | | |
1747 | 1750 | | |
1748 | 1751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
178 | 191 | | |
0 commit comments