From patchwork Wed Jul 2 18:30:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wan, Kaike" X-Patchwork-Id: 4467621 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB5B5BEEAA for ; Wed, 2 Jul 2014 18:32:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F12742038E for ; Wed, 2 Jul 2014 18:32:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B0A12035C for ; Wed, 2 Jul 2014 18:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753025AbaGBScU (ORCPT ); Wed, 2 Jul 2014 14:32:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:41658 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbaGBScT (ORCPT ); Wed, 2 Jul 2014 14:32:19 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 02 Jul 2014 11:26:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,589,1400050800"; d="scan'208";a="556555185" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by fmsmga001.fm.intel.com with ESMTP; 02 Jul 2014 11:31:06 -0700 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id s62IV5Nv000977; Wed, 2 Jul 2014 14:31:06 -0400 Received: (from kaikewan@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id s62IV5cn000973; Wed, 2 Jul 2014 14:31:05 -0400 X-Authentication-Warning: phlsvsds.ph.intel.com: kaikewan set sender to kaike.wan@intel.com using -f From: kaike.wan@intel.com To: sean.hefty@intel.com Cc: linux-rdma@vger.kernel.org, Kaike Wan Subject: [PATCH 1/1] ibacm: define prov_lib_path as a char array Date: Wed, 2 Jul 2014 14:30:50 -0400 Message-Id: <1404325850-918-1-git-send-email-kaike.wan@intel.com> X-Mailer: git-send-email 1.7.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kaike Wan This patch fixes a segfault error when the option file defines the provider lib path. The variable prov_lib_path should be a buffer (char array) instead of a char pointer. This allows a string to be copied into it during option parsing. Signed-off-by: Kaike Wan --- src/acm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/acm.c b/src/acm.c index 8f147ef..fae9d0b 100644 --- a/src/acm.c +++ b/src/acm.c @@ -193,7 +193,7 @@ static int log_level = 0; static char lock_file[128] = "/var/run/ibacm.pid"; static short server_port = 6125; static int support_ips_in_addr_cfg = 0; -static char *prov_lib_path = IBACM_LIB_PATH; +static char prov_lib_path[256] = IBACM_LIB_PATH; void acm_write(int level, const char *format, ...) {