aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2022-05-01 19:21:17 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2022-05-01 19:22:16 +0000
commit50daf3d28888226dc32e493b53ffc588a65cca5e (patch)
tree0d56bad0d22d5b35034e6135bb716ec78fde9d9b
parent82856edcb9b4f89a6881737fe64c6678966f4fe0 (diff)
downloadports-50daf3d28888226dc32e493b53ffc588a65cca5e.tar.gz
ports-50daf3d28888226dc32e493b53ffc588a65cca5e.zip
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.
-rw-r--r--net/netatalk3/Makefile1
-rw-r--r--net/netatalk3/files/patch-libatalk_adouble_ad__open.c13
2 files changed, 14 insertions, 0 deletions
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;