Commit b203126
committed
Replace the signed-int (... & 0xFF) << 24 reassembly in dns_callback's A-record
path with the safe memcpy+ee32 get_be32 helper (hoisted out of the
IP_MULTICAST gate so it is unconditionally available) so a high-bit top
octet (>= 0x80) can no longer trigger ISO C11 6.5.7p4 undefined behavior
on the int shift, with test_regression_dns_callback_high_bit_octet_ip_no_ub pinning
the contract under -fsanitize=undefined.1 parent 95bc67b commit b203126
3 files changed
Lines changed: 75 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| 397 | + | |
397 | 398 | | |
398 | 399 | | |
399 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5187 | 5187 | | |
5188 | 5188 | | |
5189 | 5189 | | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
| 5218 | + | |
| 5219 | + | |
| 5220 | + | |
| 5221 | + | |
| 5222 | + | |
| 5223 | + | |
| 5224 | + | |
| 5225 | + | |
| 5226 | + | |
| 5227 | + | |
| 5228 | + | |
| 5229 | + | |
| 5230 | + | |
| 5231 | + | |
| 5232 | + | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
5190 | 5255 | | |
5191 | 5256 | | |
5192 | 5257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
1637 | 1645 | | |
1638 | 1646 | | |
1639 | 1647 | | |
| |||
1664 | 1672 | | |
1665 | 1673 | | |
1666 | 1674 | | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
1675 | 1675 | | |
1676 | 1676 | | |
1677 | 1677 | | |
| |||
8919 | 8919 | | |
8920 | 8920 | | |
8921 | 8921 | | |
8922 | | - | |
8923 | | - | |
8924 | | - | |
8925 | | - | |
| 8922 | + | |
8926 | 8923 | | |
8927 | 8924 | | |
8928 | 8925 | | |
| |||
0 commit comments