From patchwork Tue Mar 17 05:48:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 450874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5D5E3140140 for ; Tue, 17 Mar 2015 16:48:25 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3E4771A0BD3 for ; Tue, 17 Mar 2015 16:48:25 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e28smtp04.in.ibm.com (e28smtp04.in.ibm.com [122.248.162.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 84A501A0BC0 for ; Tue, 17 Mar 2015 16:48:22 +1100 (AEDT) Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Mar 2015 11:18:19 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 17 Mar 2015 11:18:18 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 342403940048 for ; Tue, 17 Mar 2015 11:18:18 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay04.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2H5mHGm35258460 for ; Tue, 17 Mar 2015 11:18:17 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2H5mGZm018899 for ; Tue, 17 Mar 2015 11:18:16 +0530 Received: from localhost.localdomain ([9.124.35.128]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t2H5mGhU018890 for ; Tue, 17 Mar 2015 11:18:16 +0530 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Tue, 17 Mar 2015 11:18:16 +0530 Message-ID: <20150317054816.23099.21672.stgit@localhost.localdomain> In-Reply-To: <20150317054754.23099.66143.stgit@localhost.localdomain> References: <20150317054754.23099.66143.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15031705-0013-0000-0000-0000043685C1 Subject: [Skiboot] [PATCH 2/2] hdata: Fix location code size X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Location codes are no more than 80 characters (including terminating NULL char). Signed-off-by: Vasant Hegde --- 0 files changed diff --git a/hdata/slca.c b/hdata/slca.c index 9dd679e..aaa5fc6 100644 --- a/hdata/slca.c +++ b/hdata/slca.c @@ -79,13 +79,13 @@ const char *slca_get_loc_code_index(uint16_t slca_index) void slca_vpd_add_loc_code(struct dt_node *node, uint16_t slca_index) { const char *fru_loc_code; - char loc_code[LOC_CODE_SIZE + 1]; + char loc_code[LOC_CODE_SIZE]; memset(loc_code, 0, sizeof(loc_code)); fru_loc_code = slca_get_loc_code_index(slca_index); if (!fru_loc_code) return; - strncpy(loc_code, fru_loc_code, LOC_CODE_SIZE); + strncpy(loc_code, fru_loc_code, LOC_CODE_SIZE - 1); dt_add_property(node, "ibm,loc-code", loc_code, strlen(loc_code) + 1); }