From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.audio.sox.devel Subject: Re: sox src/coreaudio device name truncation fix Date: Wed, 15 Jun 2016 07:22:52 +0000 Message-ID: <20160615072252.GA13636@dcvr.yhbt.net> References: <1465929413.3110479.637612809.34A344C0@webmail.messagingengine.com> Reply-To: sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1465976405 7399 80.91.229.3 (15 Jun 2016 07:40:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jun 2016 07:40:05 +0000 (UTC) To: sox-devel@lists.sourceforge.net Original-X-From: sox-devel-bounces@lists.sourceforge.net Wed Jun 15 09:39:51 2016 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of yhbt.net designates 64.71.152.64 as permitted sender) client-ip=64.71.152.64; envelope-from=normalperson@yhbt.net; helo=dcvr.yhbt.net; Content-Disposition: inline In-Reply-To: <1465929413.3110479.637612809.34A344C0@webmail.messagingengine.com> X-Spam-Score: -2.9 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [64.71.152.64 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1bD5QO-0006F3-8L X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox.devel:486 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bD5QS-000164-SQ for gcasd-sox-devel@m.gmane.org; Wed, 15 Jun 2016 09:39:49 +0200 Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bD5QQ-00026z-F4; Wed, 15 Jun 2016 07:39:46 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bD5QP-00026r-3X for sox-devel@lists.sourceforge.net; Wed, 15 Jun 2016 07:39:45 +0000 Received: from dcvr.yhbt.net ([64.71.152.64]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1bD5QO-0006F3-8L for sox-devel@lists.sourceforge.net; Wed, 15 Jun 2016 07:39:45 +0000 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C94F91FF40; Wed, 15 Jun 2016 07:22:52 +0000 (UTC) gqrxzy8974@ftml.net wrote: > I haven't tested this but it appears the code: > > https://sourceforge.net/p/sox/code/ci/master/tree/src/coreaudio.c#l154 > char name[256]; > status = AudioDeviceGetProperty(devices[i],0,false,kAudioDevicePropertyDeviceName,&property_size,&name); > > Needs to have > property_size = sizeof(name); > added before the AudioDeviceGetProperty call. > > Otherwise property_size has the left over length from the previous request for the list of devices. I'm seeing > returned names truncated to 11 characters which is 12 including the \0 which matches the > 3 device id's (at 4 bytes each) returned by the previous use of property_size. Seems reasonable. Can you test this? (or provide at least provide a documentation reference). If not, is there someone else here who can? Thanks. ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381