Index: head/security/openct/Makefile =================================================================== --- head/security/openct/Makefile (revision 438156) +++ head/security/openct/Makefile (revision 438157) @@ -1,59 +1,59 @@ # Created by: Janos Mohacsi # $FreeBSD$ PORTNAME= openct PORTVERSION= 0.6.20 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= SF/opensc/${PORTNAME} MAINTAINER= ale@FreeBSD.org COMMENT= Middleware framework for smart card terminals LICENSE= LGPL21 LIB_DEPENDS= libltdl.so:devel/libltdl OPTIONS_DEFINE= PCSC DOCS PCSC_DESC= Enable PC/SC support GNU_CONFIGURE= yes USES= gmake libtool pkgconfig USE_LDCONFIG= yes USE_RC_SUBR= openct SUB_FILES= etoken.conf CONFIGURE_ENV= LTLIB_CFLAGS="-I${LOCALBASE}/include" \ LTLIB_LIBS="-L${LOCALBASE}/lib -lltdl" CONFIGURE_ARGS= --localstatedir=/var --enable-usb PORTDOCS= * PORTEXAMPLES= * .include .if ${PORT_OPTIONS:MPCSC} LIB_DEPENDS+= libpcsclite.so:devel/pcsc-lite CONFIGURE_ARGS+=--enable-pcsc PLIST_SUB+= PCSC="" .else PLIST_SUB+= PCSC="@comment " .endif .if ${PORT_OPTIONS:MDOCS} CONFIGURE_ARGS+=--enable-doc .endif post-patch: @${REINPLACE_CMD} -e '/PKG_CONFIG/s/libusb/&-0.1/' \ -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \ ${WRKSRC}/configure @${REINPLACE_CMD} 's|install-data-am: install-dist_apidocDATA install-dist_docDATA|install-data-am: install-dist_docDATA|' \ ${WRKSRC}/doc/Makefile.in post-install: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKDIR}/etoken.conf ${STAGEDIR}${EXAMPLESDIR} .include Index: head/security/openct/files/patch-src_pcsc_pcsc.c =================================================================== --- head/security/openct/files/patch-src_pcsc_pcsc.c (nonexistent) +++ head/security/openct/files/patch-src_pcsc_pcsc.c (revision 438157) @@ -0,0 +1,50 @@ +--- src/pcsc/pcsc.c.orig 2007-05-25 21:11:45 UTC ++++ src/pcsc/pcsc.c +@@ -25,6 +25,7 @@ + #ifdef DEBUG_IFDH + #include + #endif ++#include + #ifdef __APPLE__ + #include + #include +@@ -390,6 +391,10 @@ IFDHTransmitToICC(DWORD Lun, SCARD_IO_HE + ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; + slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; + ++ if (TxLength > USHRT_MAX) { ++ (*RxLength) = 0; ++ return IFD_PROTOCOL_NOT_SUPPORTED; ++ } + #ifdef HAVE_PTHREAD + pthread_mutex_lock(&ifdh_context_mutex[ctn]); + #endif +@@ -399,7 +404,7 @@ IFDHTransmitToICC(DWORD Lun, SCARD_IO_HE + #endif + dad = (UCHAR) ((slot == 0) ? 0x00 : slot + 1); + sad = 0x02; +- lr = (unsigned short)(*RxLength); ++ lr = (*RxLength > USHRT_MAX) ? USHRT_MAX : (unsigned short)(*RxLength); + lc = (unsigned short)TxLength; + + ret = CT_data(ctn, &dad, &sad, lc, TxBuffer, &lr, RxBuffer); +@@ -438,6 +443,10 @@ IFDHControl(DWORD Lun, PUCHAR TxBuffer, + ctn = ((unsigned short)(Lun >> 16)) % IFDH_MAX_READERS; + slot = ((unsigned short)(Lun & 0x0000FFFF)) % IFDH_MAX_SLOTS; + ++ if (TxLength > USHRT_MAX) { ++ (*RxLength) = 0; ++ return IFD_PROTOCOL_NOT_SUPPORTED; ++ } + #ifdef HAVE_PTHREAD + pthread_mutex_lock(&ifdh_context_mutex[ctn]); + #endif +@@ -447,7 +456,7 @@ IFDHControl(DWORD Lun, PUCHAR TxBuffer, + #endif + dad = 0x01; + sad = 0x02; +- lr = (unsigned short)(*RxLength); ++ lr = (*RxLength > USHRT_MAX) ? USHRT_MAX : (unsigned short)(*RxLength); + lc = (unsigned short)TxLength; + + ret = CT_data(ctn, &dad, &sad, lc, TxBuffer, &lr, RxBuffer); Property changes on: head/security/openct/files/patch-src_pcsc_pcsc.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property