Date: Mon, 8 Feb 2021 17:08:17 +0100 From: Lutz Donnerhacke <lutz@donnerhacke.de> To: Mark Johnston <markj@freebsd.org> Cc: Lutz Donnerhacke <donner@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 45d75e3ac3fb - main - netgraph/ng_base: Allow larger BINARY2ASCII conversions Message-ID: <20210208160817.GA4953@belenus.iks-jena.de> In-Reply-To: <YCFWLmXYL5E79yKM@raichu> References: <202102081335.118DZB5F024911@gitrepo.freebsd.org> <YCFWLmXYL5E79yKM@raichu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 08, 2021 at 10:18:06AM -0500, Mark Johnston wrote: > On Mon, Feb 08, 2021 at 01:35:11PM +0000, Lutz Donnerhacke wrote: > > The branch main has been updated by donner: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > > > commit 45d75e3ac3fb5bf8230ca28dc09b48c6e5ed7a4f > > Author: Lutz Donnerhacke <donner@FreeBSD.org> > > AuthorDate: 2021-02-07 21:07:34 +0000 > > Commit: Lutz Donnerhacke <donner@FreeBSD.org> > > CommitDate: 2021-02-08 13:31:58 +0000 > > > > netgraph/ng_base: Allow larger BINARY2ASCII conversions > > > > Allocate the necessary memory for the conversion dynamically starting > > with a value which is sufficient for almost all normal cases. > > Is there some upper bound on the length of the input message? Yes. Quote from D23840: : Of course, to transmit the data via the ng_socket, the buffer sizes needs : to be adjusted manually. : net.graph.recvspace: 204800 : net.graph.maxdgram: 204800 : To transmit arbitary large data, it's better to change the ng_socket : interface (incl. libnetgraph), but that is out of scope of this issue : here. > If not, a sufficiently large input looks like it could cause an infinite > loop by triggering overflow in the bufSize *= 2 calculation. That's a valid point. Thank you. > I also wonder why the same change was not made for ASCII2BINARY. Because it's usually a compression. If you are able to send the ASCII message, the binary message is shorter and will match anyway. But to answer your question: It was not part of the PR, it's an nonissue.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210208160817.GA4953>