From patchwork Sun Jun 12 20:57:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Mills X-Patchwork-Id: 873242 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5CKvMjA024264 for ; Sun, 12 Jun 2011 20:57:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285Ab1FLU5S (ORCPT ); Sun, 12 Jun 2011 16:57:18 -0400 Received: from frost.carfax.org.uk ([212.13.194.111]:48110 "EHLO frost.carfax.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636Ab1FLU5R (ORCPT ); Sun, 12 Jun 2011 16:57:17 -0400 Received: from ruthven.carfax.org.uk ([10.0.0.10]) by frost.carfax.org.uk with esmtp (Exim 4.72) (envelope-from ) id 1QVriY-0001Oe-4n for linux-btrfs@vger.kernel.org; Sun, 12 Jun 2011 20:57:12 +0000 Received: from [10.0.0.10] (helo=ruthven.carfax.org.uk) by ruthven.carfax.org.uk with esmtp (Exim 4.72) (envelope-from ) id 1QVriU-00053y-QE for linux-btrfs@vger.kernel.org; Sun, 12 Jun 2011 21:57:06 +0100 From: Hugo Mills To: Btrfs mailing list Subject: [PATCH] btrfs-progs: Fix over-sized limit on buffer Date: Sun, 12 Jun 2011 21:57:06 +0100 Message-Id: <13b1c964d3bbd1ce59b89b1671e2c5da239e8931.1307912196.git.hugo@carfax.org.uk> X-Mailer: git-send-email 1.7.2.5 To: linux-btrfs@vger.kernel.org X-frost.carfax.org.uk-Spam-Score: -0.0 (/) X-frost.carfax.org.uk-Spam-Report: Spam detection software, running on the system "admin.kwak.bitfolk.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: gcc-4.4 complains (rightly) that the strncpy has a limit too large for the array it's copying into. Use the correct array length. Signed-off-by: Hugo Mills --- btrfs_cmds.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) [...] Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 12 Jun 2011 20:57:22 +0000 (UTC) gcc-4.4 complains (rightly) that the strncpy has a limit too large for the array it's copying into. Use the correct array length. Signed-off-by: Hugo Mills --- btrfs_cmds.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/btrfs_cmds.c b/btrfs_cmds.c index 7de28b6..9d94f6f 100644 --- a/btrfs_cmds.c +++ b/btrfs_cmds.c @@ -427,7 +427,7 @@ int do_clone(int argc, char **argv) } args.fd = fd; - strncpy(args.name, newname, BTRFS_PATH_NAME_MAX); + strncpy(args.name, newname, BTRFS_SUBVOL_NAME_MAX); res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args); e = errno;