FreeBSD Bugzilla – Attachment 174217 Details for
Bug 212261
x11/xsel-conrad: Fix memory leak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
xsel-conrad.diff
xsel-conrad.diff (text/plain), 3.84 KB, created by
Tobias Kortkamp
on 2016-08-30 15:39:50 UTC
(
hide
)
Description:
xsel-conrad.diff
Filename:
MIME Type:
Creator:
Tobias Kortkamp
Created:
2016-08-30 15:39:50 UTC
Size:
3.84 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 421115) >+++ Makefile (working copy) >@@ -3,6 +3,7 @@ > > PORTNAME= xsel > PORTVERSION= 1.2.0 >+PORTREVISION= 1 > CATEGORIES= x11 > MASTER_SITES= http://www.vergenet.net/~conrad/software/xsel/download/ > PKGNAMESUFFIX= -conrad >@@ -17,24 +18,22 @@ > LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept > > CONFLICTS_INSTALL= xsel-[0-9]* >-USE_XORG= x11 xext xt xproto ice sm >-CFLAGS+= -I${LOCALBASE}/include >-LDFLAGS+= -L${LOCALBASE}/lib -lXext -lX11 >-PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz >-PORTDOCS= ChangeLog README >+ >+USES= autoreconf localbase >+USE_XORG= x11 xt > GNU_CONFIGURE= yes > >+PLIST_FILES= bin/${PORTNAME} \ >+ man/man1/${PORTNAME}.1.gz >+ >+PORTDOCS= ChangeLog README >+ > OPTIONS_DEFINE= DOCS > >-post-patch: >- @${REINPLACE_CMD} -e 's|jmp_buf|sigjmp_buf|g' ${WRKSRC}/xsel.c >- @${REINPLACE_CMD} -e 's|@X_CFLAGS@|${CFLAGS}|;\ >- s|@X_LIBS@|${LDFLAGS}|' ${WRKSRC}/Makefile.in >- > do-install: >- @${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/ >- @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1x ${STAGEDIR}${MAN1PREFIX}/man/man1/${PORTNAME}.1 >- @${INSTALL} -d ${STAGEDIR}${DOCSDIR}/ >- @cd ${WRKSRC}/&&${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/ >+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/ >+ ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1x ${STAGEDIR}${MAN1PREFIX}/man/man1/${PORTNAME}.1 >+ @${MKDIR} ${STAGEDIR}${DOCSDIR}/ >+ @cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/ > > .include <bsd.port.mk> >Index: files/patch-xsel.c >=================================================================== >--- files/patch-xsel.c (nonexistent) >+++ files/patch-xsel.c (working copy) >@@ -0,0 +1,61 @@ >+$OpenBSD: patch-xsel_c,v 1.2 2014/07/07 08:25:16 sthen Exp $ >+ >+- Format "32" properties use "long", not "int", even on LP64 platforms. >+- ensure NUM_TARGETS does not exceed MAX_NUM_TARGETS. >+- plug a memory leak in handle_targets() >+ >+--- xsel.c.orig 2008-02-12 04:50:18 UTC >++++ xsel.c >+@@ -15,6 +15,7 @@ >+ #include "config.h" >+ #endif >+ >++#include <assert.h> >+ #include <stdio.h> >+ #include <stdlib.h> >+ #include <stdarg.h> >+@@ -465,7 +466,7 @@ get_timestamp (void) >+ */ >+ >+ /* The jmp_buf to longjmp out of the signal handler */ >+-static jmp_buf env_alrm; >++static sigjmp_buf env_alrm; >+ >+ /* >+ * alarm_handler (sig) >+@@ -1300,14 +1301,16 @@ handle_targets (Display * display, Windo >+ Atom selection, Time time, MultTrack * mparent) >+ { >+ Atom * targets_cpy; >++ HandleResult r; >+ >+ targets_cpy = malloc (sizeof (supported_targets)); >+ memcpy (targets_cpy, supported_targets, sizeof (supported_targets)); >+ >+- return >+- change_property (display, requestor, property, XA_ATOM, 32, >++ r = change_property (display, requestor, property, XA_ATOM, 32, >+ PropModeReplace, (unsigned char *)targets_cpy, >+ NUM_TARGETS, selection, time, mparent); >++ free(targets_cpy); >++ return r; >+ } >+ >+ /* >+@@ -2078,7 +2081,6 @@ main(int argc, char *argv[]) >+ >+ /* Get the NULL atom */ >+ null_atom = XInternAtom (display, "NULL", False); >+- NUM_TARGETS++; >+ >+ /* Get the TEXT atom */ >+ text_atom = XInternAtom (display, "TEXT", False); >+@@ -2097,6 +2099,8 @@ main(int argc, char *argv[]) >+ supported_targets[s++] = XA_STRING; >+ NUM_TARGETS++; >+ >++ assert(NUM_TARGETS <= MAX_NUM_TARGETS); >++ >+ /* Get the COMPOUND_TEXT atom. >+ * NB. We do not currently serve COMPOUND_TEXT; we can retrieve it but >+ * do not perform charset conversion. > >Property changes on: files/patch-xsel.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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
tobik
:
maintainer-approval?
Actions:
View
|
Diff
Attachments on
bug 212261
: 174217