From owner-svn-ports-all@freebsd.org  Tue Jan 19 22:33:16 2021
Return-Path: <owner-svn-ports-all@freebsd.org>
Delivered-To: svn-ports-all@mailman.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.nyi.freebsd.org (Postfix) with ESMTP id 346CC4E1E71;
 Tue, 19 Jan 2021 22:33:16 +0000 (UTC)
 (envelope-from jpaetzel@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4DL3Mc14gBz4qjx;
 Tue, 19 Jan 2021 22:33:16 +0000 (UTC)
 (envelope-from jpaetzel@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13D78683D;
 Tue, 19 Jan 2021 22:33:16 +0000 (UTC)
 (envelope-from jpaetzel@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 10JMXFke046975;
 Tue, 19 Jan 2021 22:33:15 GMT (envelope-from jpaetzel@FreeBSD.org)
Received: (from jpaetzel@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id 10JMXF51046974;
 Tue, 19 Jan 2021 22:33:15 GMT (envelope-from jpaetzel@FreeBSD.org)
Message-Id: <202101192233.10JMXF51046974@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to
 jpaetzel@FreeBSD.org using -f
From: Josh Paetzel <jpaetzel@FreeBSD.org>
Date: Tue, 19 Jan 2021 22:33:15 +0000 (UTC)
To: ports-committers@freebsd.org, svn-ports-all@freebsd.org,
 svn-ports-head@freebsd.org
Subject: svn commit: r562095 - in head/multimedia/libdvdcss: . files
X-SVN-Group: ports-head
X-SVN-Commit-Author: jpaetzel
X-SVN-Commit-Paths: in head/multimedia/libdvdcss: . files
X-SVN-Commit-Revision: 562095
X-SVN-Commit-Repository: ports
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-ports-all@freebsd.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: SVN commit messages for the ports tree <svn-ports-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-ports-all>,
 <mailto:svn-ports-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-ports-all/>
List-Post: <mailto:svn-ports-all@freebsd.org>
List-Help: <mailto:svn-ports-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-ports-all>,
 <mailto:svn-ports-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jan 2021 22:33:16 -0000

Author: jpaetzel
Date: Tue Jan 19 22:33:15 2021
New Revision: 562095
URL: https://svnweb.freebsd.org/changeset/ports/562095

Log:
  Fix potential buffer overflow.
  
  Along the way improve port Makefile
  
  PR:	252321
  Submitted by:	daniel.engberg.lists@pyret.net

Added:
  head/multimedia/libdvdcss/files/
  head/multimedia/libdvdcss/files/patch-src_libdvdcss.c   (contents, props changed)
Modified:
  head/multimedia/libdvdcss/Makefile

Modified: head/multimedia/libdvdcss/Makefile
==============================================================================
--- head/multimedia/libdvdcss/Makefile	Tue Jan 19 22:32:23 2021	(r562094)
+++ head/multimedia/libdvdcss/Makefile	Tue Jan 19 22:33:15 2021	(r562095)
@@ -2,9 +2,10 @@
 # $FreeBSD$
 
 PORTNAME=	libdvdcss
-PORTVERSION=	1.4.2
+DISTVERSION=	1.4.2
+PORTREVISION=	1
 CATEGORIES=	multimedia
-MASTER_SITES=	http://download.videolan.org/pub/${PORTNAME}/${PORTVERSION}/
+MASTER_SITES=	https://download.videolan.org/pub/${PORTNAME}/${DISTVERSION}/
 
 MAINTAINER=	jpaetzel@FreeBSD.org
 COMMENT=	Portable abstraction library for DVD decryption
@@ -12,9 +13,10 @@ COMMENT=	Portable abstraction library for DVD decrypti
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
+USES=		libtool pathfix tar:bzip2
+
 RESTRICTED=	CSS code may violate the DMCA
 
-USES=		gmake libtool pathfix tar:bzip2
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 INSTALL_TARGET=	install-strip

Added: head/multimedia/libdvdcss/files/patch-src_libdvdcss.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/libdvdcss/files/patch-src_libdvdcss.c	Tue Jan 19 22:33:15 2021	(r562095)
@@ -0,0 +1,23 @@
+--- src/libdvdcss.c.orig	2018-03-02 15:44:29 UTC
++++ src/libdvdcss.c
+@@ -320,7 +320,19 @@ static int init_cache_dir( dvdcss_t dvdcss )
+         return -1;
+     }
+ 
+-    sprintf( psz_tagfile, "%s/" CACHE_TAG_NAME, dvdcss->psz_cachefile );
++    i_ret = snprintf( psz_tagfile, PATH_MAX, "%s/" CACHE_TAG_NAME,
++                      dvdcss->psz_cachefile );
++    if ( i_ret < 0 || i_ret >= PATH_MAX)
++    {
++        if ( i_ret < 0)
++            print_error( dvdcss, "failed to compose cache directory tag path");
++        else
++            print_error( dvdcss, "cache directory tag path too long: %s/" CACHE_TAG_NAME,
++                         dvdcss->psz_cachefile );
++        dvdcss->psz_cachefile[0] = '\0';
++        return -1;
++    }
++
+     i_fd = open( psz_tagfile, O_RDWR|O_CREAT, 0644 );
+     if( i_fd >= 0 )
+     {