Commit 6fb913b
unix: return early on error in Recvmsg
Currently, Recvmsg may access the rsa buffer even if the underlying syscall
returns an error.
This change aligns Recvmsg with the safer logic already
used in RecvmsgBuffers, ensuring the address is only processed when
the syscall succeeds (err == nil).
Fixes golang/go#76848
Change-Id: If76477d0362b802e54ee6d27d0e8f57024a8a1dc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/734740
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>1 parent 2f44229 commit 6fb913b
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
371 | 373 | | |
372 | 374 | | |
373 | 375 | | |
| |||
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
392 | | - | |
393 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
394 | 398 | | |
395 | 399 | | |
396 | 400 | | |
| |||
0 commit comments