From 5de3103a06c4c0d27f8283d5ce9f77d391d62a93 Mon Sep 17 00:00:00 2001 From: brooks Date: Thu, 11 Mar 2010 06:15:42 +0000 Subject: Dynamically size group arrays rather than using the soon to be removed NGROUPS define. The previous code also under allocated space by a factor of 3 and probably lead to memory corruption. --- devel/libmsocket/Makefile | 1 + devel/libmsocket/files/patch-file.c | 55 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 devel/libmsocket/files/patch-file.c diff --git a/devel/libmsocket/Makefile b/devel/libmsocket/Makefile index ba8ab4ce8f52..a60f03f34747 100644 --- a/devel/libmsocket/Makefile +++ b/devel/libmsocket/Makefile @@ -7,6 +7,7 @@ PORTNAME= libmsocket PORTVERSION= 0.4 +PORTREVISION= 1 CATEGORIES= devel net MASTER_SITES= SF/kageki/${PORTNAME}/${PORTNAME}-${PORTVERSION} diff --git a/devel/libmsocket/files/patch-file.c b/devel/libmsocket/files/patch-file.c new file mode 100644 index 000000000000..298dd90d06ce --- /dev/null +++ b/devel/libmsocket/files/patch-file.c @@ -0,0 +1,55 @@ + +$FreeBSD$ + +--- file.c.orig ++++ file.c +@@ -171,6 +171,7 @@ + gid_t l; + register unsigned int i; + int grpcnt; ++ long ngroups_max; + + if (!fs) + { +@@ -212,13 +213,14 @@ + return(1); + } + +- glist = (gid_t *)malloc(NGROUPS + 1); ++ ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; ++ glist = (gid_t *)malloc(sizeof(gid_t) * ngroups_max); + if (!glist) + { + return(-1); + } + +- if ((grpcnt = getgroups((NGROUPS + 1), glist)) < 0) ++ if ((grpcnt = getgroups(ngroups_max, glist)) < 0) + { + free(glist); + return(-1); +@@ -257,6 +259,7 @@ + gid_t l; + register unsigned int i; + int grpcnt; ++ long ngroups_max; + + if (!fs) + { +@@ -298,13 +301,14 @@ + return(1); + } + +- glist = (gid_t *)malloc(NGROUPS + 1); ++ ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1; ++ glist = (gid_t *)malloc(sizeof(gid_t) * ngroups_max); + if (!glist) + { + return(-1); + } + +- if ((grpcnt = getgroups((NGROUPS + 1), glist)) < 0) ++ if ((grpcnt = getgroups(ngroups_max, glist)) < 0) + { + free(glist); + return(-1); -- cgit tion> FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/archivers/p5-Archive-Tar-Wrapper
Commit message (Expand)AuthorAgeFilesLines
* Remove # $FreeBSD$ from Makefiles.Mathieu Arnold2021-04-061-1/+0
* Update to 0.38Sunpoet Po-Chuan Hsieh2020-09-152-4/+4
* Update to 0.37Sunpoet Po-Chuan Hsieh2019-08-262-4/+4
* Remove outdated PERL_LEVEL checkSunpoet Po-Chuan Hsieh2019-05-131-7/+1
* Update to 0.36Sunpoet Po-Chuan Hsieh2019-04-152-4/+4
* Update to 0.35Sunpoet Po-Chuan Hsieh2019-04-062-4/+4
* Update to 0.34Sunpoet Po-Chuan Hsieh2019-03-242-6/+7
* Fix every instance of RUN_DEPENDS:=${BUILD_DEPENDS} in p5 ports, exceptDag-Erling Smørgrav2018-10-061-2/+2
* Update to 0.33Sunpoet Po-Chuan Hsieh2018-07-282-4/+5
* Update to 0.29Sunpoet Po-Chuan Hsieh2018-06-282-4/+4
* Update to 0.28Sunpoet Po-Chuan Hsieh2018-06-232-6/+6
* Update to 0.27Sunpoet Po-Chuan Hsieh2018-06-212-5/+11
* Update to 0.25Sunpoet Po-Chuan Hsieh2018-06-062-4/+4
* Update to 0.24Sunpoet Po-Chuan Hsieh2018-06-052-4/+4
* Update WWWSunpoet Po-Chuan Hsieh2018-05-281-1/+1