The branch releng/11.4 has been updated by gordon:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=fab38dac650664eb614ab28ff2535d97bec21e89

commit fab38dac650664eb614ab28ff2535d97bec21e89
Author:     Gordon Tetlow <gor...@freebsd.org>
AuthorDate: 2021-08-24 18:02:42 +0000
Commit:     Gordon Tetlow <gor...@freebsd.org>
CommitDate: 2021-08-24 18:02:42 +0000

    Fix libfetch out of bounds read.
    
    Approved by:    so
    Security:       SA-21:15.libfetch
    Security:       CVE-2021-36159
---
 lib/libfetch/ftp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index c034b5efa240..1755012fc99b 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -702,8 +702,11 @@ ftp_transfer(conn_t *conn, const char *oper, const char 
*file,
                                goto ouch;
                        }
                        l = (e == FTP_PASSIVE_MODE ? 6 : 21);
-                       for (i = 0; *p && i < l; i++, p++)
+                       for (i = 0; *p && i < l; i++, p++) {
                                addr[i] = strtol(p, &p, 10);
+                               if (*p == '\0' && i < l - 1)
+                                       break;
+                       }
                        if (i < l) {
                                e = FTP_PROTOCOL_ERROR;
                                goto ouch;
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to