From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzXRp-0003wh-6l for qemu-devel@nongnu.org; Fri, 02 Sep 2011 13:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzXRn-0008Az-Vp for qemu-devel@nongnu.org; Fri, 02 Sep 2011 13:22:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzXRn-0008At-GU for qemu-devel@nongnu.org; Fri, 02 Sep 2011 13:22:31 -0400 Date: Fri, 2 Sep 2011 14:22:24 -0300 From: Luiz Capitulino Message-ID: <20110902142224.3ae25b71@doriath> In-Reply-To: <4E57DFBD.1020500@siemens.com> References: <6ffbd56b9b714a41c021499a50ecac8e7a8e022b.1314370059.git.jan.kiszka@siemens.com> <4E57BA82.703@siemens.com> <4E57C011.4040103@siemens.com> <4E57DFBD.1020500@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/6] Add base64 encoder/decoder List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Peter Maydell , Anthony Liguori , qemu-devel , mdroth@linux.vnet.ibm.com On Fri, 26 Aug 2011 20:02:37 +0200 Jan Kiszka wrote: > On 2011-08-26 17:47, Jan Kiszka wrote: > > On 2011-08-26 17:23, Jan Kiszka wrote: > >> On 2011-08-26 17:21, Peter Maydell wrote: > >>> On 26 August 2011 15:48, Jan Kiszka wrote: > >>>> Will be used by QBuffer. > >>> > >>> Is it possible to use the glib base64 encode/decode routines instead > >>> of rolling our own here? > >> > >> Yeah, times are changing. Need to check what's there and how to use it. > > > > Requires glib >= 2.12, we are currently at >= 2.0, right? Would it be OK > > to raise the entry barrier? > > > > I'm also still looking for error handling of g_base64_decode. I guess > > one is supposed to compare returned length against some expected value. > > Well, it's glib... > > The length check is not sufficient, and glib's decoder fails on my > invalid input string tests. > > I think proper error detection in base64 inputs is a worthwhile feature > that glib lacks. So I'll stick with roll-our-own (actually, it's > Mozilla's version). The guest-agent is using glib's to implement file read & write, I think it should switch to Jan's implementation?