From patchwork Sun May 11 21:28:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 347823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AFE85140077 for ; Mon, 12 May 2014 07:28:42 +1000 (EST) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s4BLScAI007153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 11 May 2014 21:28:38 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4BLSbwX014775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 May 2014 21:28:38 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WjbIT-00047v-Qa; Sun, 11 May 2014 14:28:37 -0700 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WjbII-00046w-DG for fedfs-utils-devel@oss.oracle.com; Sun, 11 May 2014 14:28:26 -0700 Received: from userp1020.oracle.com (userp1020.oracle.com [156.151.31.79]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4BLSPkH014651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 11 May 2014 21:28:26 GMT Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by userp1020.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s4BLSOxW027933 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sun, 11 May 2014 21:28:25 GMT Authentication-Results: userp1020.oracle.com; dkim=pass reason="2048-bit key" header.d=gmail.com header.i=@gmail.com header.b=do/ZPj7/ Received: by mail-ie0-f182.google.com with SMTP id tp5so6213652ieb.27 for ; Sun, 11 May 2014 14:28:24 -0700 (PDT) X-Received: by 10.50.79.227 with SMTP id m3mr35184585igx.47.1399843704292; Sun, 11 May 2014 14:28:24 -0700 (PDT) Received: from seurat.1015granger.net ([2604:8800:100:81fc:20c:29ff:fe44:ec31]) by mx.google.com with ESMTPSA id vm7sm16909856igb.1.2014.05.11.14.28.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 May 2014 14:28:23 -0700 (PDT) To: fedfs-utils-devel@oss.oracle.com From: Chuck Lever Date: Sun, 11 May 2014 17:28:23 -0400 Message-ID: <20140511212823.13852.8887.stgit@seurat.1015granger.net> In-Reply-To: <20140511212416.13852.92639.stgit@seurat.1015granger.net> References: <20140511212416.13852.92639.stgit@seurat.1015granger.net> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=209.85.223.182 ct-class=R5 ct-vol1=-92 ct-vol2=8 ct-vol3=7 ct-risk=49 ct-spam1=78 ct-spam2=6 ct-bulk=6 rcpts=1 size=759 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=QuRngzCd c=1 sm=1 tr=0 a=7cV2i8DUNOkwDoH5hk/jLQ==:117 a=dzsqy3y4QnMA:10 a=ZDLYgFpcai0A:10 a=dPGociXpb70A:10 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=yPCof4ZbAAAA:8 a=Lb1rMZzfAAAA:8 a=1XWaLZrsAAAA:8 a=sw6hJ06elPGvd6SIzEcA:9 a=QEXdDO 2ut3YA:10 a=7DSvI1NPTFQA:10 X-Sendmail-CT-RefID: str=0001.0A090207.536FEB79.0050, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-Sendmail-CT-Classification: not spam Subject: [fedfs-utils] [PATCH 02/17] libnsdb: Fix possible buffer overrun in nsdb_parse_nfs_uri_fsl() X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet22.oracle.com [141.146.126.238] Ensure the contents placed in string[] will always be '\0'-terminated. Fixes: 04a9ffdfdb3ae73724b4293eade7d7c9dc342d8f Signed-off-by: Chuck Lever --- src/libnsdb/fileserver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnsdb/fileserver.c b/src/libnsdb/fileserver.c index 3b76de9..c3a0e29 100644 --- a/src/libnsdb/fileserver.c +++ b/src/libnsdb/fileserver.c @@ -896,7 +896,7 @@ nsdb_parse_nfs_uri_fsl(const char *attr, UriUriA *uri, size_t portlen; portlen = uri->portText.afterLast - uri->portText.first; - if (portlen > sizeof(string)) { + if (portlen > sizeof(string) - 1) { xlog(D_GENERAL, "%s: NFS URI has invalid port", __func__, attr); goto out;