Commit cfbaa08
authored
Exclude NUL characters from OSStrings returned by getsockopt (#2557)
* Exclude NUL characters from OSStrings returned by getsockopt
On FreeBSD, getsockopt appends a single NUL to the returned string. On
Linux, it pads the entire buffer with NULs. But both of those behaviors
may be version-dependent. Adjust GetOsString to handle any number of
NUL characters.
* fixup: fix MSRV breakage
* Fixup: expand the comment1 parent e7e9809 commit cfbaa08
File tree
3 files changed
+26
-9
lines changed- changelog
- src/sys/socket
- test/sys
3 files changed
+26
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
1745 | 1745 | | |
1746 | 1746 | | |
1747 | 1747 | | |
1748 | | - | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
1749 | 1757 | | |
1750 | 1758 | | |
1751 | 1759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
253 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
254 | 255 | | |
255 | 256 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 257 | + | |
| 258 | + | |
260 | 259 | | |
261 | 260 | | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
272 | 280 | | |
273 | 281 | | |
274 | 282 | | |
| |||
0 commit comments