FreeBSD Bugzilla – Attachment 229792 Details for
Bug 260117
[libc][patch] Faulty errno for sctp_getladdrs() in net/sctp_sys_calls.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug patch
sctp_sys_calls.c.patch (text/plain), 880 bytes, created by
Albin Hellqvist
on 2021-11-29 14:01:59 UTC
(
hide
)
Description:
Bug patch
Filename:
MIME Type:
Creator:
Albin Hellqvist
Created:
2021-11-29 14:01:59 UTC
Size:
880 bytes
patch
obsolete
>diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c >index 66a0f6adac3a..c232112a11c9 100644 >--- a/lib/libc/net/sctp_sys_calls.c >+++ b/lib/libc/net/sctp_sys_calls.c >@@ -407,6 +407,10 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) > return (-1); > } > /* size required is returned in 'asoc' */ >+ if ((size_t)asoc == 0) { >+ errno = ENOTCONN; >+ return (-1); >+ } > opt_len = (socklen_t)((size_t)asoc + sizeof(struct sctp_getaddresses)); > addrs = calloc(1, (size_t)opt_len); > if (addrs == NULL) { >@@ -463,10 +467,6 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockaddr **raddrs) > errno = ENOMEM; > return (-1); > } >- if (size_of_addresses == 0) { >- errno = ENOTCONN; >- return (-1); >- } > opt_len = (socklen_t)(size_of_addresses + sizeof(struct sctp_getaddresses)); > addrs = calloc(1, (size_t)opt_len); > if (addrs == NULL) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 260117
: 229792