From nobody Thu Feb 29 20:24:09 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tm2kK4JZPz5CrVk; Thu, 29 Feb 2024 20:24:09 +0000 (UTC) (envelope-from git@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 4Tm2kK1wpqz4gmx; Thu, 29 Feb 2024 20:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709238249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=87L/GsZYjg8L703kRYMTqNI0I6Z+8tTeN6qAYft9CsQ=; b=Fe3SxnpyMp5//R7VG+iIt1X3hxlOqmW4y5FzX+4FrVEE2Tvu+ubU6LO+2soRM2SoX9Ly4K UagZsczkp5Fd8oBbDadD1mN68SEy1sFaVaufWOKEihQkt1KQdOyeEcOnWVLVIYFOgmFO06 Y+W6go9akIPXJBxqnRUgTmlByf5ZXNlHNup0EibVZO4vldl3uumWW4FHyHWaPlo7UT0Rwy S52MNvIcJIhTflpOS4Odr2OxRxgrHL9KaDwcvtCktRRKtlF1x5PAP6RHxHN1gx1gua9RMC XCuCONKfzVXzpTlFQrUwfNESkGzFqAXCaTle3jMvuHVxEdQngShHENV6pn/mGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709238249; a=rsa-sha256; cv=none; b=CrUOHEzHB5ZCjMrlD4B8vrWhVjkRSvc7/dw3DBJdFK3Ny3bWlYIrVsgfj56gPVAFLtAb7B Us6qUxfMiyRPr9uTQYrb6cZAIxG9CHihk4wD4ei4ksQnfvFn/+Z5r2gCGI83YRUHI1ckXu tt+e7FdaMAtQ1wN2h3errKUwaNvL34uR+IGCfBjTpvJV71kNujT+Yg4LvC8Hiw/eeTV1Y+ 37RuFaCMw48oXn8tJQ2pOSKPIK5Ucx5fh4tjIuj4/nzkfbAwIGbri0dZ00eofoihQRexFg ahZS2SOUT4q73N2cPHTBV/htF/bv97XbVEOojOil0G5PEIKIKoddqjihGC5g6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709238249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=87L/GsZYjg8L703kRYMTqNI0I6Z+8tTeN6qAYft9CsQ=; b=gYB5Vt3OvTJYnCN2FdnmtQOk+IRahjmzgyrNGR018LVIU/q132CrSK3UIQcqYlA/9p8Alf JRGJToIk0Ekm9uN2WhAfhWMrYDKa64vWsMse6mn5zdSNC9B8N/uzE/pkvBNIY0/Cyhkc/f 4YEZ/fLdwpaPsTc/LK9ZhBbJcPJJ33aVrvBiQ1t6uYsgRMheCFo7CErZJ+PjvHLkSzu4K9 gQSWpQwVde/uQq0yoSOqaHrvtoaqGkVMc2ArD9lN0nVOVVJof5tMSq2rKsJhfI8T3fKQ23 t1h61794b9Gp2Q1YA0xYKSSlRas3X8+fs/bZB1pldIjkEQnV3YCfGz3fb8uMYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tm2kK1Xklzwq8; Thu, 29 Feb 2024 20:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41TKO9AV030761; Thu, 29 Feb 2024 20:24:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41TKO9CW030758; Thu, 29 Feb 2024 20:24:09 GMT (envelope-from git) Date: Thu, 29 Feb 2024 20:24:09 GMT Message-Id: <202402292024.41TKO9CW030758@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Tijl Coosemans Subject: git: 9827f3b51002 - main - textproc/mxml: Update to 3.3.1 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9827f3b51002e7d07c4f3fcd76484f665e95cefe Auto-Submitted: auto-generated The branch main has been updated by tijl: URL: https://cgit.FreeBSD.org/ports/commit/?id=9827f3b51002e7d07c4f3fcd76484f665e95cefe commit 9827f3b51002e7d07c4f3fcd76484f665e95cefe Author: Tijl Coosemans AuthorDate: 2024-02-24 20:20:15 +0000 Commit: Tijl Coosemans CommitDate: 2024-02-29 20:21:34 +0000 textproc/mxml: Update to 3.3.1 Also add a patch to fix a bounds check problem discovered during an exp-run for bug 276478. PR: 276478 --- textproc/mxml/Makefile | 7 ++- textproc/mxml/distinfo | 6 +- textproc/mxml/files/patch-mxml-file.c | 105 ++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+), 6 deletions(-) diff --git a/textproc/mxml/Makefile b/textproc/mxml/Makefile index 48b6e3a85c24..c982c84974fc 100644 --- a/textproc/mxml/Makefile +++ b/textproc/mxml/Makefile @@ -1,6 +1,5 @@ PORTNAME= mxml -DISTVERSION= 3.1 -PORTREVISION= 1 +DISTVERSION= 3.3.1 CATEGORIES= textproc MASTER_SITES= https://github.com/michaelrsweet/mxml/releases/download/v${DISTVERSION}/ @@ -11,13 +10,15 @@ WWW= http://www.minixml.org/ LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE -USES= desthack USE_LDCONFIG= yes +DESTDIRNAME= DSTROOT GNU_CONFIGURE= yes +GNU_CONFIGURE_MANPREFIX=${PREFIX}/share MAKE_ARGS= INSTALL_DATA="${INSTALL_DATA}" \ INSTALL_LIB="${INSTALL_LIB}" \ INSTALL_MAN="${INSTALL_MAN}" +TEST_TARGET= test OPTIONS_DEFINE= DOCS diff --git a/textproc/mxml/distinfo b/textproc/mxml/distinfo index cbd7a3011972..f6a8b32f719b 100644 --- a/textproc/mxml/distinfo +++ b/textproc/mxml/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1567960906 -SHA256 (mxml-3.1.tar.gz) = 1ac8d252f62f9dc2b2004518c70d2da313bdfcd92b8350e215f46064a34b52fc -SIZE (mxml-3.1.tar.gz) = 9268821 +TIMESTAMP = 1708794182 +SHA256 (mxml-3.3.1.tar.gz) = 0c663ed1fe393b5619f80101798202eea43534abd7c8aff389022fd8c1dacc32 +SIZE (mxml-3.3.1.tar.gz) = 1553469 diff --git a/textproc/mxml/files/patch-mxml-file.c b/textproc/mxml/files/patch-mxml-file.c new file mode 100644 index 000000000000..d4770ebffa60 --- /dev/null +++ b/textproc/mxml/files/patch-mxml-file.c @@ -0,0 +1,105 @@ +mxml-file.c: Fix a bounds check + +When writing XML data into a buffer a pointer is used to keep track of +the current position. When the end of the buffer is reached the writing +stops but the pointer continues to be incremented to determine how many +bytes would have been written had the buffer been large enough. The +problem is that the bounds check that stops the writing did not handle +the case where a large amount of data causes the pointer to wrap around +to 0. This can happen for example when the buffer is allocated on the +stack and the stack is close to the end of the address space. + +--- mxml-file.c.orig 2022-07-25 12:56:27 UTC ++++ mxml-file.c +@@ -50,6 +50,11 @@ typedef struct _mxml_fdbuf_s /**** File descriptor bu + buffer[8192]; /* Character buffer */ + } _mxml_fdbuf_t; + ++typedef struct _mxml_strbuf_s /**** String buffer ****/ ++{ ++ char *current; /* Current position in buffer */ ++ int remaining; /* Remaining size of buffer */ ++} _mxml_strbuf_t; + + /* + * Local functions... +@@ -352,41 +357,43 @@ mxmlSaveString(mxml_node_t *node, /* I - Node to wr + mxml_save_cb_t cb) /* I - Whitespace callback or @code MXML_NO_CALLBACK@ */ + { + int col; /* Final column */ +- char *ptr[2]; /* Pointers for putc_cb */ ++ _mxml_strbuf_t buf; /* State for putc_cb */ + _mxml_global_t *global = _mxml_global(); + /* Global data */ + ++ if (bufsize < 0) ++ return (-1); + + /* + * Write the node... + */ + +- ptr[0] = buffer; +- ptr[1] = buffer + bufsize; ++ buf.current = buffer; ++ buf.remaining = bufsize; + +- if ((col = mxml_write_node(node, ptr, cb, 0, mxml_string_putc, global)) < 0) ++ if ((col = mxml_write_node(node, &buf, cb, 0, mxml_string_putc, global)) < 0) + return (-1); + + if (col > 0) +- mxml_string_putc('\n', ptr); ++ mxml_string_putc('\n', &buf); + + /* + * Nul-terminate the buffer... + */ + +- if (ptr[0] >= ptr[1]) ++ if (buf.remaining == 0) + { +- if (bufsize > 0) ++ if (bufsize != 0) + buffer[bufsize - 1] = '\0'; + } + else +- ptr[0][0] = '\0'; ++ *buf.current = '\0'; + + /* + * Return the number of characters... + */ + +- return ((int)(ptr[0] - buffer)); ++ return ((int)(buf.current - buffer)); + } + + +@@ -2674,17 +2681,19 @@ mxml_string_putc(int ch, /* I - Character to write * + + static int /* O - 0 on success, -1 on failure */ + mxml_string_putc(int ch, /* I - Character to write */ +- void *p) /* I - Pointer to string pointers */ ++ void *p) /* I - String buffer */ + { +- char **pp; /* Pointer to string pointers */ ++ _mxml_strbuf_t *buf; /* String buffer */ + ++ buf = (_mxml_strbuf_t *)p; + +- pp = (char **)p; ++ if (buf->remaining != 0) ++ { ++ *buf->current = ch; ++ buf->remaining--; ++ } + +- if (pp[0] < pp[1]) +- pp[0][0] = ch; +- +- pp[0] ++; ++ buf->current++; + + return (0); + }