Commit 2056066
parse_pack_header_option(): avoid unaligned memory writes
In order to recreate a pack header in our in-memory buffer, we cast the
buffer to a "struct pack_header" and assign the individual fields. This
is reported to cause SIGBUS on sparc64 due to alignment issues.
We can work around this by using put_be32() which will write individual
bytes into the buffer.
Reported-by: Koakuma <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent fe70a4f commit 2056066
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2297 | 2297 | | |
2298 | 2298 | | |
2299 | 2299 | | |
2300 | | - | |
| 2300 | + | |
2301 | 2301 | | |
2302 | 2302 | | |
2303 | | - | |
2304 | | - | |
2305 | | - | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
2306 | 2308 | | |
2307 | 2309 | | |
2308 | | - | |
| 2310 | + | |
| 2311 | + | |
2309 | 2312 | | |
2310 | 2313 | | |
2311 | | - | |
| 2314 | + | |
2312 | 2315 | | |
2313 | 2316 | | |
0 commit comments