git: 50daf3d28888 - main - net/netatalk3: Fix SIGSEGV on login

From: Joe Marcus Clarke <marcus_at_FreeBSD.org>
Date: Sun, 01 May 2022 19:22:18 UTC
The branch main has been updated by marcus:

URL: https://cgit.FreeBSD.org/ports/commit/?id=50daf3d28888226dc32e493b53ffc588a65cca5e

commit 50daf3d28888226dc32e493b53ffc588a65cca5e
Author:     Joe Marcus Clarke <marcus@FreeBSD.org>
AuthorDate: 2022-05-01 19:21:17 +0000
Commit:     Joe Marcus Clarke <marcus@FreeBSD.org>
CommitDate: 2022-05-01 19:22:16 +0000

    net/netatalk3: Fix SIGSEGV on login
    
    If the adouble bufsize is 0 (no valid header exists yet), initialize it
    to the adouble length less the offset and eid length.
---
 net/netatalk3/Makefile                                |  1 +
 net/netatalk3/files/patch-libatalk_adouble_ad__open.c | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/net/netatalk3/Makefile b/net/netatalk3/Makefile
index d8e500a7a6b2..b9392a94e855 100644
--- a/net/netatalk3/Makefile
+++ b/net/netatalk3/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	netatalk
 PORTVERSION=	3.1.13
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net
 MASTER_SITES=	SF
diff --git a/net/netatalk3/files/patch-libatalk_adouble_ad__open.c b/net/netatalk3/files/patch-libatalk_adouble_ad__open.c
new file mode 100644
index 000000000000..086594859f40
--- /dev/null
+++ b/net/netatalk3/files/patch-libatalk_adouble_ad__open.c
@@ -0,0 +1,13 @@
+--- libatalk/adouble/ad_open.c.orig	2022-05-01 19:20:45 UTC
++++ libatalk/adouble/ad_open.c
+@@ -1637,6 +1637,10 @@ void *ad_entry(const struct adouble *ad, int eid)
+ 	size_t len = ad_getentrylen(ad, eid);
+ 	bool valid;
+ 
++	if (bufsize == 0) {
++		bufsize = sizeof(ad->ad_data) - (off + len);
++	}
++
+ 	valid = ad_entry_check_size(eid, bufsize, off, len);
+ 	if (!valid) {
+ 		return NULL;