From patchwork Fri Jul 13 10:45:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1195031 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3B38A3FC4C for ; Fri, 13 Jul 2012 10:46:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030331Ab2GMKp7 (ORCPT ); Fri, 13 Jul 2012 06:45:59 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:16486 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030272Ab2GMKp6 (ORCPT ); Fri, 13 Jul 2012 06:45:58 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q6DAjrUS023704 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Jul 2012 10:45:53 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q6DAjqmv014622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Jul 2012 10:45:53 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q6DAjq7n009845; Fri, 13 Jul 2012 05:45:52 -0500 Received: from elgon.mountain (/41.139.221.94) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 13 Jul 2012 03:45:52 -0700 Date: Fri, 13 Jul 2012 13:45:47 +0300 From: Dan Carpenter To: "Michael S. Tsirkin" , Nicholas Bellinger Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, kernel-janitors@vger.kernel.org Subject: [patch -next] tcm_vhost: another strlen() off by one Message-ID: <20120713104547.GA31435@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org strlen() doesn't count the NUL terminator. I missed this one in the patches I sent yesterday. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 29850cb..ea72198 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1424,7 +1424,7 @@ static struct se_wwn *tcm_vhost_make_tport( return ERR_PTR(-EINVAL); check_len: - if (strlen(name) > TCM_VHOST_NAMELEN) { + if (strlen(name) >= TCM_VHOST_NAMELEN) { pr_err("Emulated %s Address: %s, exceeds" " max: %d\n", name, tcm_vhost_dump_proto_id(tport), TCM_VHOST_NAMELEN);