From patchwork Fri Dec 11 21:06:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 5189 Return-Path: Received: from fmmailgate02.web.de (fmmailgate02.web.de [217.72.192.227]) by open-mesh.net (Postfix) with ESMTP id 3DF7A154365 for ; Fri, 11 Dec 2009 21:51:27 +0000 (UTC) Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id 990FA14836235 for ; Fri, 11 Dec 2009 22:06:24 +0100 (CET) Received: from [85.179.236.129] (helo=localhost) by smtp05.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #314) id 1NJCgy-0002VR-00 for b.a.t.m.a.n@lists.open-mesh.net; Fri, 11 Dec 2009 22:06:24 +0100 Date: Fri, 11 Dec 2009 22:06:23 +0100 From: Linus =?utf-8?Q?L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.net Message-ID: <20091211210623.GA3538@Linus-Debian> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linus.luessing@web.de X-Sender: linus.luessing@web.de X-Provags-ID: V01U2FsdGVkX1/ZcJKODcAGTMaDh4YinKI9Xnxjsj5/FFrzB2CA c7JZ4WdsaXuAHTOaM4/Pov7wAVRysZLciVLLE4OURLPi2xqQgh GAPJGy/Zb9W/6NvJyvPw== Subject: [B.A.T.M.A.N.] [PATCH] [batctl] Fix array out of bound exception X-BeenThere: b.a.t.m.a.n@lists.open-mesh.net X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 21:51:27 -0000 This patch fixes an array out of bound exception in line 201 of functions.c. We need to reserve one extra character for the appended null character. Signed-off-by: Linus Lüssing Index: batctl/functions.c =================================================================== --- batctl/functions.c (revision 1491) +++ batctl/functions.c (working copy) @@ -161,10 +161,10 @@ if (read_opt & USE_READ_BUFF) { read_ptr = read_buff; - read_len = sizeof(read_buff); + read_len = sizeof(read_buff)-1; } else { read_ptr = lbuff; - read_len = sizeof(lbuff); + read_len = sizeof(lbuff)-1; } open: