From patchwork Sun Jan 29 02:42:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13119998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01434C61DA4 for ; Sun, 29 Jan 2023 02:43:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbjA2CnD (ORCPT ); Sat, 28 Jan 2023 21:43:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbjA2Cm7 (ORCPT ); Sat, 28 Jan 2023 21:42:59 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3CB976A1 for ; Sat, 28 Jan 2023 18:42:55 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30T1REXo016229; Sun, 29 Jan 2023 02:42:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=8nG7wHmx01SMcshV/KfoyqtTMTNjtawhrsWDntjSngA=; b=I1xcN8UDXr5Jhj850qGHvs6xXOhuYJrUPA/XuLgsLV3qPVnuIXfazY+fahjYxKBsqhbJ tv9syIM6mtdyjMdB6HMVZILB+BwsXnIP5wh/yPXMASneW3KdfllBa1UbyEfT9iJ6gmd0 WLZ+tiOw0zagMRmXnXsadR9Vc6ft6fdd2NH6mlrzksZxoeS1vguJz8wfyVPH5vudrKly yjJYlZEVCxvaqqW6gUlj26UIPQ3fAJT+azePloNGIGM98E+b9P5AQy5gUutGtTzqxLre O3EhMi39mbZQwAMoI7NyGTPuxONPniAMR1ATGsG4djWW8mi+NDAVbal921iquH2amR7G 3A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ncvr8gwum-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:42:51 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30SLEt7a037461; Sun, 29 Jan 2023 02:42:49 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2046.outbound.protection.outlook.com [104.47.73.46]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nct59hp38-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:42:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L42b+1QBvnevUo+yaHmwDHw0wRlLOxMCl/75ZTahIW8auQyY8xMNXyviAuIKVnKb1pD5m3UYlqz7x1+N2OtGhj3akAvmiwJP1A1aRpsV9S9qEJXD5O1u/4hpnY1NwYf1Ys+gMnpYvV8ZfR2j98AIvtitVP8ai6hUc6rJ+e7l2eHZVtrrMnCm84mhDjDra25EHpnwt79nBwuh4l+sR0ACaX+jbmisaji1B0JKyU/z1RMn2p4DEULr6w2xxn3KWZJQZmnPf8cUvHXNswUCAMrYh7rdlrckO9RMH9xwNVMmBGWH7COUk9KO0mGNCinO0YzKfjZPqigLrI9w43Q84ueJrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8nG7wHmx01SMcshV/KfoyqtTMTNjtawhrsWDntjSngA=; b=X+yyIZxHaj5ZtZ1SfOOtO3lquwU5N6IFBFoxWqVw6cD2xvKf+DRnaUdyrVZdXWYbdJVnE8lHmnyOchEDs8KpOckjgZT/z55fYngxvu1nrOkDgl6BXARk0hQeYG7t+eVU0sShrv17KZsXvq+lJMe67m0DYTJGw7lr3YU6+58izKW7NwwT30kffq3knPWg37PI4KeIxkADXACS+Vlsh/AuPct8lDty4HTNo/6pyn050kJOk2bj6UQbkw/HJ3HFjm3+oF7r1IQB8M+nu3mJydR2qw8ax99U5ki2vCLbBLxF2mcOFvrIFy9nSqhcxM7KtMap5xJfOQbWP4PdYUkIHW+gMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8nG7wHmx01SMcshV/KfoyqtTMTNjtawhrsWDntjSngA=; b=uun1GOXKQ8qxYexBki8cD+7tEjVsNi1fJOmrE0IUFRdJXFToHEJ0DDy//zCYn3jLoGvbFd5q6HrAvPTufrAY6pZASHZN1CED6O7mWdmdcmCSdVFD/rt2S8Gc9z+YYRDDpixRVVt8pSM/KoIEwzj9ZiFRHCYmSjcwJZP/8taVvGY= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by IA0PR10MB6746.namprd10.prod.outlook.com (2603:10b6:208:43e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.17; Sun, 29 Jan 2023 02:42:48 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036%9]) with mapi id 15.20.6064.017; Sun, 29 Jan 2023 02:42:48 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: zlang@kernel.org Subject: [PATCH 1/4] fstests: doio.c, fix missing initialization of -C arg Date: Sun, 29 Jan 2023 10:42:30 +0800 Message-Id: X-Mailer: git-send-email 2.33.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR04CA0007.apcprd04.prod.outlook.com (2603:1096:4:197::19) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|IA0PR10MB6746:EE_ X-MS-Office365-Filtering-Correlation-Id: 075e6227-53db-4d0a-e3bd-08db01a281f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kah05SSAeQ3d46NsBjaXQofzushigv5e5A0svIB9HFB25c6AFEVQRyor8uzE9CbaI4vQ20en/BbL/pgPeLih9QKPGAg9xbIqI1W54w7HFQpONoSsxE2hX7JJvllp45xzCIBcTTcy5EVJZhBbUZY7goR5Nl4Tt7PSIvqpS2jSLhpNlwroWePi11SkIrBeKhmOVTp13jxIaIQ+DU6+lysYSZTkqEz8TPbLbEhL7FqZy2mMmKUAn9IkFqpw5z/n7CWFhDhS+W7SSE4bGf0HIa6cTSEdKc9kxVThuwkvpObNn/QL4epKsL5s+FynNx+yAByRQk4hikmOcm75VSDSyjVep7habnDMc+BwAT4ARBvQVQsqkL9wHY/atlUsOdTTbL4yDI4fxtMDEM8+n+7msx2oa+1K1Fc5v6CghHa7VR14cCUuIIli+8e0Ovy0y/DGCpg6O1mtd99vSgqcCH3okjxebHxTfThBX+No/jB8RpGQkaYjlGY0SvMNh6wmS7CmTZxLaKpbcirLeX/n1OC6F+AJNr8KThm6oeT7F2OSoxjc1EaN4402keqq0tTTvaEG4tn2YC/USi830a9VZuj+g+SO0APOrjhq4L8JLLWJo5c8ejJwy4XqO3lH4xpElqf4p4GFQkNkIbqhUCocpaeEWLHogg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(39860400002)(346002)(396003)(366004)(136003)(451199018)(6486002)(478600001)(26005)(83380400001)(86362001)(38100700002)(186003)(6512007)(36756003)(2616005)(6666004)(6506007)(4326008)(6916009)(8676002)(66476007)(66946007)(66556008)(4744005)(5660300002)(316002)(8936002)(41300700001)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1y4fGAGKQoRYWogqzWOiLjWNuT5ilTTDb8/lV7t0Dldz9oflRhCO1b0j4C65jq7oI8+mTbiG+iWbZ+OimfjXw7E5d5LOgCaUQZCmRFh8kSjfCWuu1xqNh9FsGCXgB2Svj+OOQYs/0TYXTGJCV6Xkfin0LUejl8Dt1qZ1Zc5hWQSa2N46wRmz9HayWWnlj9LLrrOX7HeUjxDaWvra4+WBTDbPc0kFHj6mlcHInIenQhF9Feo2dRNWG5vaa6dTDHYdVYYzyck9kTu+K13RVVidKE00lx/ws1KtAbxyOlLH1wK1FJYCTSnFzIYB/8oVA/N3XErQlLE032NSf3OSpV0yZiYwYc9+bgtssxFoxTJ/2a8kotEoaObLhsFIKSdm7MHRTEzKgTw1VL8vvaSOKiRZ5IjTYh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E2lMAWZst9RqBcn423Xi4H7XqZJXyt+r8qpWHXGtXzRhtVtlwy0ZDV+RhBJ9vzdOF3MXLREAQGEevIH/KFmlCfWwbEue3n10HOubAq/kKVHT/MXn4oRLTeQRBeS+olR5z6fVZ6pg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Jy8TxgmbubBMP/j4IUPn/wnsoJS8HNLKKsdAvdBvtxhDYjSnZwjWXX9ysYBMCG0kIv2byYkRNiuJInAF+XVprPl7mI2pgay69XRvDj38aEniWyJrDJZKHkd201c9giHC1onjtfvrUCizBV3kDkAITuGgsBL2Ht/WcHEKihpRTYnsqi/i/bziWncy7VAbrTy7BOF8/AWpYBRsN6hWVEC+NqK/mT1Tk0nXAR/tqalp+TkGJqyIBjXgAz8v/WfjfSa+m8tyNnIy6qLy9wHAJnDrdAqI6GRlnj4nxpTXPjlAJ0eazpET0ESrv6IU2zR2j8bh4DtbzT4yq7Pj11W9Rsq4rUaKy5DZyhSd3pjlEHTBSSU6Kr+OzIqVNhvt3qKwrGg+QTiyismMYXKdf5U4FG4hkjdh8AWQloVw4y39FSQ8kENwPYVf0B7zhzMjvMFDtl61x02A1QfItqJ82of0Vqyz+UfJezL01i1xYeUuGen8tPz/pGF31bTkJvVAfb/8aCTLQTPTtqtegOVT1gEXb5g/39C0BHqqL0ZPvVUFJWPnunyrf6707w/wNst9aIf2rdVtJOYhM5VVuq9exakDtF7DhcxaHSbEjLdQ7gRx30iIHdWTBU1Q/+toh1jHQxQRJt8qb6tXF7S7tRY8q9cXtV3n2EpM0fLeG5hPy9RDYd4SgjBUMhPU9mxA7YyYUaIW3CtKm4joIzENeSwgDEd/OMyLtWX/efrOe2KTRkEKSe22oYTRVMutEpRm+etQMh4lVGPG38oP9vK1Z56GCIFnDBZQQnd+7fOt0cNOSCuYIgG6egI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 075e6227-53db-4d0a-e3bd-08db01a281f4 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2023 02:42:48.0946 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ToR+siovgzbFCce8BkJG31E9eoxglpk0SQLuXarvYGOfB5tBTpiGI0CnkO3li0FhnOrbYFanwXh/zTwgOzH6hw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6746 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-29_01,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301290024 X-Proofpoint-GUID: 07dtQ0-8X-aXENLGXnVDWEvVVklJK7uB X-Proofpoint-ORIG-GUID: 07dtQ0-8X-aXENLGXnVDWEvVVklJK7uB Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Resolves GCC warnings on null values for %tok. doio.c: In function 'parse_cmdline': doio.c:3113:33: warning: '%s' directive argument is null [-Wformat-overflow=] 3113 | fprintf(stderr, | ^~~~~~~~~~~~~~~ 3114 | "%s: Illegal -C arg (%s). Must be one of: ", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3115 | Prog, tok); | ~~~~~~~~~~ Signed-off-by: Anand Jain --- ltp/doio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ltp/doio.c b/ltp/doio.c index 83f8cf556325..fd64df0f674e 100644 --- a/ltp/doio.c +++ b/ltp/doio.c @@ -3106,6 +3106,7 @@ char *opts; case 'C': C_opt++; + tok = strtok(optarg, ","); for(s=checkmap; s->string != NULL; s++) if(!strcmp(s->string, optarg)) break; From patchwork Sun Jan 29 02:42:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13119999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D171C61D97 for ; Sun, 29 Jan 2023 02:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233395AbjA2CnF (ORCPT ); Sat, 28 Jan 2023 21:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbjA2CnE (ORCPT ); Sat, 28 Jan 2023 21:43:04 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7122083EC for ; Sat, 28 Jan 2023 18:43:00 -0800 (PST) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30T0x4rg031584; Sun, 29 Jan 2023 02:42:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=V99m4V+Hc6DCYPl0ZwbrMuzrSlSPV/R6rM23BzAOcF0=; b=mr9bT4Noo5hYsxAl/wamK4c6bJhIstiPV1x6G2wu0ix4EnPeJA5yryd7UmwJ4+3NvgcX liibSMG4tCwwAxMkxi1j+DgvOVaze/tgvty4Tg9NqJ94GfS1aoxu8ou7clWM6D0XM7PT EwXuv9sVDM8nYMU0JoqvdwVGxJiZ+2JiqzRKH7S76r8fJAGmBO7QctHGQkW3iUJ8brWu XXR1xu903MWpCMfKruXgiUeOszReKZ9mNuCz/ovFcN1ZDevMHjsAY/rKkDJAULoxeY6T z7dXgLy6PE77JoVvSbZTZOsHP41cw/bHqbuUcR2smrgZJ7x77pC9d4eSQUI+pQRHW1DC og== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ncvp10x06-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:42:58 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30SLea2E019130; Sun, 29 Jan 2023 02:42:57 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nct5315xb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:42:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ele1kxz+/k7LPZ5rtQeMfCUAZZI3irRezgTgleo5ZqO63RGP9gZD3p/0OKBIU1rm9eUXMKlcF6EExid/KEAwaYMqqlf9bDN5cBAfhcsdDLkrLSlub5IoGG+OvU31BJKKyOBZXotW5jJchsa44gHKHzOw0xV1Pv1pklV9+k3CfFXBPD9Zzk1RlHPDUpt70Pa9a+LiD1qi2foO0PnkEVAeDr+cmehsVQVqT1SAUuLCLZ0uVzpTDO1rTlgsPdqFlXYOF5CGVylbVgbKI84jWdSeP/415eB8yTvmdtFmgn50BMLLj/mqXvymo75M2B8+xpNpcfz7GGQ+lfevecRij0tYhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V99m4V+Hc6DCYPl0ZwbrMuzrSlSPV/R6rM23BzAOcF0=; b=mU29GVF1Oim5jJq/Qo4PDlB6pG++E0S/CM+9vgjIJhejubxOazKsB8WJnvRGBO0hVoambn7N/oKWo0UkIeCNsxN7w+2f2NZPxqpffyPcSiBqUqvHE5Oi0SJUD67E36pxEPl8DKHjR70HjmzTCsxAuzF1mafcUzVe7HEdeAAeGn0leEr+k4myXTsye7Qw0GDKgxlfevCB1VT0sYSFIyNc6iHQCsn9J2lJrju59pfzLBP5A7tkwuvd7T36ly0loy85n4Yjs98/J0sGkNqzBpy3HTHSWcd+IlK9oj5rW406a1NJu3sTUQqJRmthyjLXKX5AQSbW1qPIxy9aSjQxC6uC8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V99m4V+Hc6DCYPl0ZwbrMuzrSlSPV/R6rM23BzAOcF0=; b=rThu5FxDK9sdTOd0jUDc8Ya+2085ZDCeLf1wwyD9ZGCbwUGbA9PQPZCadKNS7cb/EfeOU88JgqcMyK7rcsZU0B2zP0gTHCyl15cjgBoLfwPQGquEN6kMONw/oOxsIXg+ZJ0CyPjX53pGsqBicNLJs7nijCqzVS3mivg4AfkIK8I= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by IA0PR10MB6746.namprd10.prod.outlook.com (2603:10b6:208:43e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.17; Sun, 29 Jan 2023 02:42:55 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036%9]) with mapi id 15.20.6064.017; Sun, 29 Jan 2023 02:42:55 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: zlang@kernel.org Subject: [PATCH 2/4] fstests: fstest.c, fix compile warnings replace sprintf with snprintf Date: Sun, 29 Jan 2023 10:42:31 +0800 Message-Id: X-Mailer: git-send-email 2.33.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0001.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::7) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|IA0PR10MB6746:EE_ X-MS-Office365-Filtering-Correlation-Id: 89e60a44-da3c-4d03-22c8-08db01a28634 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bx83ZNfupw4VI3p4lHCnqikH+ngQlsd2oHDk/ybDhQW/4WBOBvyvRSSWN67IMwqR6cZJHHqdXwklh7e1TM2qMSS8t5EVskCmkzGgWFnbgcrK/+Py9IxONIveHHvhcNK2h3PaQadvIrq6RAvIb9Msb8C+ty0qD1KFHTSQqGDfUO8yJRaGJZzKF2hdPOfSheloRgCz6i5UV4sO3wMCmj7jQDWzaW/s5Pp5qKOVFm4Wr9POeFWpIb87pGBPheOGawQCW2kxtkwG7ICo8fJk03RAw5BnzaVn2F1lcSkFcFZ2zLD3lv3V48z/L4zq3quq+eKfQvHKpoJNxhA4yzA/jlV6bSjhySJRSLK9pf5NFNDYc2jLsfuRvBmvdEapIpJrhzC3oaAgxCj2sb9jV4FGDhFkW1k4o43eBUo3zSzltnq9F8fYBFHZq0+30kOWc7Tj/s7C2vmdR5pyrfIYVBOsroVF/gun30/a4kF8prWhhD1B4QSuyWUIJcZyaiexXFxNFP7n3/UgQJTjQNyMYMAmZpYnqI9A75BMAleTJ84W3EusOb+0PHcCvjsHguSBxW4To5F9JeaY0G/PntfwJAwDzwKdJScBcxfyM+TtAa7UPrSVrsh3R8BaRSVPjUnBg/1dr7xtYeOCKyEDgwDDeHOWBlzKRQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(39860400002)(346002)(396003)(366004)(136003)(451199018)(6486002)(478600001)(26005)(83380400001)(86362001)(38100700002)(186003)(6512007)(36756003)(2616005)(6666004)(6506007)(4326008)(6916009)(8676002)(66476007)(66946007)(66556008)(5660300002)(316002)(8936002)(41300700001)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B79rcNWm88tLo4PZUFxbX1lUUPrpi6tFW9vic0PSUfSoki2faJV5eKsHpqr8HHZ4pT7ndUGytrwQ76YsKlrSlZSqEZ6EBde6dC+s3PSTdh14fCzFIXVc8N8Kj/r3vi7//9dd9bnGOyIR3oWWfPdIiG7O/YoPlnoDVHnVkM72JbICs3FrSyk5fk8dkMTe2P+p6Dwe/4wYbzMSBn+kuAVz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gMS1ZXalWs/Xezik2xsWNpmilG+kHIwrvT01SbAzQr5P/xql+7F8h2/QEYpQGJO/FRP2cWKMlWLxCOVfYek+IUqOIGCooldDM3KWF9hEMXkIYKB6AKaGwr0LVbB2ztlkhNRv3eszommZYFr+QTyZm9A4ilNI1DjzHA9bxnYZv6w7uznTaez8CsML6AptMY7nvzSdZxi0zWFQMVGfizzTimezQE0+6qdnEl5iFNRIrow5+8CAnOnEw9D+uK5U/s3A/kmplHkTXg+F/mnnGhd1UK/5f98f+tWKn0q9aK540G0za5KOBsA4Msmw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: khBGLnMWttJY7WibCE39n2Q+GzSOt5XGpbeYlhk1pRuKJqqNVkQm/A4Clgi2kn0y02UKBRA8QPkGMA0EPTF8Tq0YBYSEgt12XBwgf96l4gwYNJTsQ/FKPt5Yx/wXaVDHSMSa7AsMs6fV+zEdKr2SKnesIFsZ5Tx2d/n77bLT55zACGOBx6anQTptWWX41yibn3V6LfgA5CgppbiX41lgyP5hWD0C37qLs5qrrWlozy+WmiGWsNWT/hznafbnNVLLKHc71vZ6D0IUvEB3zygI31Io76USpISsaUBOf6yENnMCnYdfsAZwgbC1R4lju8k7Q2oKme0sdf3h4dbf3ipunAAqyYkKircpw9qJyuKU4tt3wt9qNItxusX0gSVluKOw8Gd8nwMxppa3jutT2BipNcvTele0nhMcgC6/CruXAbTBymEfgyQn0tCj7CzsD5WSx6XTuh5U5UjbxjcWxkcuaRSBWVbU9wgy9iw5+sQrXGQkBJhJvcDCwPhC41rxuLpCgD4YLRL5wMZyKG3s2JZeA0NH0r/85JESd2CICsOEjNYjhbbls/dkqJfuEhKm0eTygTTUc6COJ3x8h3xKAW32T1Dy0L67FRNzjw0mte+n2waALlNjRSV2tKoy5HZPNXKm8fVX3XfmPQ97MKy1RAYkeDXBzH1nDiaigJ/OPFiSG0L6CxLn+PTl1P7mxzzi+H5AL/Sn9bTYyragNgDvJO5m3ckVcg1YKbM4mkgEX9cY2wFWQ4Vg6tsXAscrbfmqvAQa9MrUkoyLdf7LUo8mYNIcwWTS77V3x1G9ZeBpUdxcIic= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89e60a44-da3c-4d03-22c8-08db01a28634 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2023 02:42:55.3451 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZI47rQg7WrlE0rgKUra1X/zUe45/D/wXhp9sFHXd5dXIrBwMfhBCHq1LM3beW/P+S1lr+ZZD7JMeAb3h9Ux+8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6746 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-29_01,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301290025 X-Proofpoint-GUID: 4p618NACJlcXbq4i1ZmoAq02JGew-uu1 X-Proofpoint-ORIG-GUID: 4p618NACJlcXbq4i1ZmoAq02JGew-uu1 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Fixes the buffer overflow warnings, by using snprintf instead of sprintf. fstest.c:95:20: warning: '/file' directive writing 5 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(fname, "%s/file%d", dir, fnum); ^~~~~ fstest.c:166:20: warning: '/file' directive writing 5 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(fname, "%s/file%d", dir, fnum); Signed-off-by: Anand Jain --- src/fstest.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/fstest.c b/src/fstest.c index e4b9e081144a..4f6dc643dd12 100644 --- a/src/fstest.c +++ b/src/fstest.c @@ -88,11 +88,16 @@ static void check_buffer(uchar *buf, int loop, int child, int fnum, int ofs) static void create_file(const char *dir, int loop, int child, int fnum) { char *buf; - int size, fd; + int size, fd, ret; char fname[1024]; buf = x_malloc(block_size); - sprintf(fname, "%s/file%d", dir, fnum); + ret = snprintf(fname, sizeof(fname), "%s/file%d", dir, fnum); + if (ret < 0 || ret >= sizeof(fname)) { + fprintf(stderr,"file path '%s' too long %d\n", dir, ret); + exit(1); + } + fd = open(fname, O_RDWR|O_CREAT|O_TRUNC | (use_sync?O_SYNC:0), 0644); if (fd == -1) { perror(fname); @@ -158,12 +163,16 @@ bozo! static void check_file(const char *dir, int loop, int child, int fnum) { uchar *buf; - int size, fd; + int size, fd, ret; char fname[1024]; buf = x_malloc(block_size); - sprintf(fname, "%s/file%d", dir, fnum); + ret = snprintf(fname, sizeof(fname), "%s/file%d", dir, fnum); + if (ret < 0 || ret >= sizeof(fname)) { + fprintf(stderr,"file path is '%s' too long %d\n", dir, ret); + exit(1); + } fd = open(fname, O_RDONLY); if (fd == -1) { perror(fname); From patchwork Sun Jan 29 02:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13120000 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A063EC61D97 for ; Sun, 29 Jan 2023 02:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234490AbjA2CnL (ORCPT ); Sat, 28 Jan 2023 21:43:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbjA2CnI (ORCPT ); Sat, 28 Jan 2023 21:43:08 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F7B5CDD7 for ; Sat, 28 Jan 2023 18:43:07 -0800 (PST) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30T05H5k007755; Sun, 29 Jan 2023 02:43:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=YB/0awCy5x35aDeq45R9VA2fg4z8fOZwJ8n37S0fBDw=; b=ZcX3o0CRdZEFq8eFG3YUDirGyvsKVmFdrUAjiG+ueH1um/vz7X9HactKWqXd/YeddaxX 8GDFhrXEQT9EFqB8FDYTejCnevhSJf0lDDLl/a2uYrIJjv0ZKJ7pWLlLaF/TdgNvh9Jy Zvh5U5jMi4X6v++0nfssEi24msmmjbCKwMj3wKKmSrbTt1TJ/ploANA9VSvZe5pOIjIQ y9eGxju8Vsn0nvf/vIdI0kE11Fc/bCvBYmeQZsWoaRo/Wu9WZaT03qr3DrVIpSpvGC3X SW1DHuso2Z3FZZ+jfw9tdt7crO8XDsLpBaC3eyMVbicatQFgra+jA8Jr+IfQmWEGBhlf wg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ncvp10x09-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:43:05 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30SLTgkW000779; Sun, 29 Jan 2023 02:43:04 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2047.outbound.protection.outlook.com [104.47.74.47]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nct52sj53-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:43:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oEbQfAjOfIkIOrJlW+MdzLTu6RAjc9KyJn+lMZ+qy12aFRdCRacEsJK0oN3QJ35nwdIe1P58JEL8pRXHX5bLBUovSYemgOsJolLYrgZVcM8lDjb7kJp/OMKtnnxwX4zu3QHHtbTd5c1I1cqir+V0r9vH2yRaAprUBnpvZiK0b8dbNOx7ZzWo3Uwb8/9WZDF57sNMtIY6bE9m0Fgck9ah7qIKrfPzeF/XieGiD7M25Ow8Vz4uxgXoTRKdF5OqhVAsWYVB/hfLO4Sa2aE0Sv3NrWk9EQ1gENySkbnQDukfV1k9V8uvWZZyxam6/YnkCPEXQLn3r2bDoNbz4Yl9LDZbEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YB/0awCy5x35aDeq45R9VA2fg4z8fOZwJ8n37S0fBDw=; b=EDH6VXKaRNehh728Ny8qH+9O9XaRWuolVXEvtvz9lprpRXT1QWYTB/t0W9HWcNyA3GTQOHghdJV+wk+ODbpn3mso/l0cfaAaNQLr79/tmkFOjamBtCN3cs7vSV4TTf+doanUEmWIS9D/Zb60rspx3Hsi4yf2bz4sr5Q1dCUlWPlOyF+1mYMrRwQ5/WDwklsnXZKn+GVLaUNELKCcSittwszENESJ8KkUwDgidQj0C+5QHPZbOCeBqDAL0vgskBH9nXPqjufT/atDLlXQd5QOdYX4WDqMODfyLm/zKzDitafu9IFeUJnxn4AX2KX6ush/kJ62Y7xbeenCh7/6UgauXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YB/0awCy5x35aDeq45R9VA2fg4z8fOZwJ8n37S0fBDw=; b=NTctbP8MxPtyG+xO384ipkiN6ULTjvOyi+AbuwGHAv2SRMkn4HNuYb6kgP/lT4DcLU8UWomV/rmJopRaQn3KmPyJkmaRYCfE0tRX+Bjhtv5IGwpwnlBdAbPzqoLUer2rBR5en9GFrcRBweyI+N4tePIfuOqp7jNVmK9/QqdK+tw= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by IA0PR10MB6746.namprd10.prod.outlook.com (2603:10b6:208:43e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.17; Sun, 29 Jan 2023 02:43:02 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036%9]) with mapi id 15.20.6064.017; Sun, 29 Jan 2023 02:43:02 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: zlang@kernel.org Subject: [PATCH 3/4] fstests: t_getcwd.c, fix a warning related to buffer overflow Date: Sun, 29 Jan 2023 10:42:32 +0800 Message-Id: <7c1a98e17fdd0248c7d68302c28bd910883274ab.1674870429.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR04CA0012.apcprd04.prod.outlook.com (2603:1096:4:197::14) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|IA0PR10MB6746:EE_ X-MS-Office365-Filtering-Correlation-Id: 5642b4ff-4876-404f-6035-08db01a28a35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 08fSdlLflQ4nA3q3xoZH1Lg2J82gOgCNSV+PQ9Yc1C9RJnH80gNpAEEMmLwstB5VkMg9uqNX8rPm2shMAIB9L9oktZ/C+5P8JH1NaxlbqQXVZZff947Hr313Vs4Bcylg0Hg6SjW022I/+GjlzqmZ/kU38f2K3zIpul4BF4lQUa7SIGpk1fX1JZzfZhYPx8YLuIvaIz8Ve/J6Uc1XUiQKQo2e3fXmroKU8Gh6A5zf4xiMiDReLppVvXsHGzkXERDKEx8lYPPLKuNqooClvjW66ZFFIid5y51HPvsYoly5kXPZpvNTHbXtHbcExnXZhcshVQ3OP/dsRkv77xN9tTD3JoLetJbfgP4RMF6Okzvwm5ha2BUfAh+5zNb11Bf5/RmfchVZIDOs7FWn30od9iR0HyT3Kol4KSDXfz72jRF5ExL/cnncnzOVI+gdDosrSYxh1bxj2+i6iYxJ8AImXqsx+aNOc3GwClLo6XiNsELHLEPxpgmFNei9/Vp9+nKBk4HWK6Cee1u+OdK6mQ6eY11VBIeqMo4eYpEBZZKjixFUtsHbe9NAL/ES+yzOciIr0H76x5Rq9qlnoamj0YYjkxAa8p9o0f57uOfTrrmvbrp6z2yoRdDuioHyks39SG4taPBkdy5WPN7r0SZA08b3EGFuhw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(39860400002)(346002)(396003)(366004)(136003)(451199018)(6486002)(478600001)(26005)(83380400001)(86362001)(38100700002)(186003)(6512007)(36756003)(2616005)(6666004)(6506007)(4326008)(6916009)(8676002)(66476007)(66946007)(66556008)(5660300002)(316002)(8936002)(41300700001)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: btH6MMzW2tizFdc7GWcDZK3II3Tf05DBZlTl+sdYSX5jFWXCapKjgU/0YFBynMygLCCruDDUZP4Ff26AoJu3OO96JtXWmj+62quYioaVl2NNpTE90lyxRvzirDHF374C47oWugU8Ie2+VpEZwBc+7mKfG7dMO1UI3wAYDjrh7e7R4Wrfaig1I9rF+Y5sEeb50fkb/3oJpCpjkjGBPBGzo6v2HjzGNJU+qzC3iDF1hnGuoe9OvvPwV0HD091YNKdWfXBCcBGffRufizgRSqEtR4xUv8OjYM/VTpbAqh4WWm4yc+HXVXC11f/10H2LC2rpWNjcHADUcJvpL3Fo1Q40pLcPW761EBLJGVOdeOg+1qk3w1pcwS+xmcN8q7b8hLNZ7JkdqTNhfzAGUblmOdAjPzzLZVL9pUxtTJqxBb7zIGLWOLu2KKBcZjULUlAmVgy6cELQRAqYGOH1S7uSGrIz1V/5+kAkzffmNZbzNtIEgw++k6LFx1Pf5CrFlyxcYl1M5uJgUG4yCJSDw6zAfVUZWBMWblib7Lc2lLpUauqh9YzfFeUoPACeeDOYPLXoGC4dlIblGQIY6bTqC9skipT/EbW0fok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pam-ExternalHop-MessageData-0: 4u5Mzhnx14lihHjVOIM+XbzRgQ5lUyIAAfrrR2wxwX7hxh4E4+JCGhGyQfEoI+lLlBg0WMaolZJqw3Q2cjWOm+yD8uVYc8cw0GpiHY8B/i6vibfJd4KG0zhaPwwULTBhxjUAnVyaOxAt6CsnfFNc9ADcMiMBUFrv5mJIjSscLiWcdVHj3NO7tMYuwvo2UVbnF8mwjuM8Zvip+udZ0CqA+PwoRDrIpg0mXeqEl5fM5EH/I0Ryhu4o2tDZhMq9CQ31sn0RkRmOvXjw0PH3GyPJ65iJw68XmsV7WyV3ZQ0FfNKrh5Kn2HdgKkkB8LTgFFZoX3Xdf1BQSkSccLVfw/DmB7PxHs2lQ0Wd8fDiJLXe4FBGVXfvAv5aUGXR+DBvANdlWUWeC13580Agsu6BAD+SMVU767vD6DzlhL8GC1fER3X+y2qlw9JZo5JUXFysTvkv1rd49BuHYrhdwhRUQyY1tIJRlgI21h9jw5MkOmmlqoRzIEGID7jRXtC7XMVW/OblMkkZWVXXOG42PLMXRPygg8VgFqsKAslGZ+fMWETDh+5m/stbgKjALG1VUdBaVxETCcmqabVnm/DZMa9iEL7UB2u8a0irqeknTCL61oZ9npquUKk1whQYz6+2mwbWx5KVSDQmjLYx3HLnUHXqjZxqr+V0I/iVS5hApwgryGHmDNnLLvPZybQch8CE0Lbs99JmwxJtxubAEHOkOcoJe60Ui3MMbfj1kS0Jf/QFNFCcHnHKqUbMnVSSMe990Htc+IhInjqBEfgR+VB6T8i+4d/umzTKSkgvgbC4cIhYSVCmzgU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5642b4ff-4876-404f-6035-08db01a28a35 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2023 02:43:01.8921 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: miG+jFarAsJiAy7Oaq156onRboFg1Sylg3bAFYJWWiYBAOPgVKAO+pNZr+8vPc/EjhrxAcLlqhWi32YzlkRzYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6746 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-29_01,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301290025 X-Proofpoint-GUID: tu0WGbm7Wyv6iSTyl38bZg0gUtV4_k-0 X-Proofpoint-ORIG-GUID: tu0WGbm7Wyv6iSTyl38bZg0gUtV4_k-0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org GCC reports warning related to 'strncpy' and its specified bound being equal to the destination buffer size. t_getcwd.c: In function 'do_rename': t_getcwd.c:40:2: warning: 'strncpy' specified bound 256 equals destination size [-Wstringop-truncation] strncpy(c_name, prefix, BUF_SIZE); A buffer overflow is unlikely here because the only caller for do_rename() sends a 16 char long %prefix and BUF_SIZE is defined as 256. The change is made to reduce the buffer length in order to silence compilation warning. Signed-off-by: Anand Jain --- src/t_getcwd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/t_getcwd.c b/src/t_getcwd.c index 27255bd024e1..e9b5d7feb31f 100644 --- a/src/t_getcwd.c +++ b/src/t_getcwd.c @@ -30,14 +30,14 @@ int test_getcwd(char *init_cwd) return 0; } -void do_rename(char *prefix) +static void do_rename(char *prefix) { int i = 0; int fd; char c_name[BUF_SIZE]; char n_name[BUF_SIZE]; - strncpy(c_name, prefix, BUF_SIZE); + strncpy(c_name, prefix, BUF_SIZE - 1); fd = open(c_name, O_CREAT | O_RDWR, 0644); if (fd < 0) { From patchwork Sun Jan 29 02:42:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13120001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DF43C38142 for ; Sun, 29 Jan 2023 02:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbjA2CnU (ORCPT ); Sat, 28 Jan 2023 21:43:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233982AbjA2CnR (ORCPT ); Sat, 28 Jan 2023 21:43:17 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35FC8E3AD for ; Sat, 28 Jan 2023 18:43:14 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30SNmFR0012560; Sun, 29 Jan 2023 02:43:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=JRnKKT0Z1zyFA4p7LYoG+U6K3t2v1Xn5BKeBAEwdg9A=; b=F3+pJzaqiJ5kys7jzuU91g8yCp1QJ7NagKA3hBd8cARJf9zFMKD9p6aCzbVfhs+Pg0Ln EuguLUNwyYvmhiEi1rptwmS/k6jYie/CejhChkOzPhdqaOOh1enecl9I1ZCrXF5ATsJ2 BtjaiwnFhRKsaXDwym/NRWn+cajNoE6bwTWZo2vpMLhl8BOpXE8UhKsi2zTGUNLD157z rYQAo794AoggElYV2PsIwlzXI1i+YmIsiN+LhIuq1nVY0TxjAPK/oKbh3lI2PaDcsv0u t0haL0iP+hefnaWO6axwFHAd258tI9H6nJO8ShSFXWo2+i5TROKBZvZlmrf0ULTNKfyC SQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ncvq9gwwk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:43:12 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30SKYoCw000791; Sun, 29 Jan 2023 02:43:11 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2049.outbound.protection.outlook.com [104.47.74.49]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3nct52sj71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Jan 2023 02:43:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Su6uP0e0JWoNTslzAPwBSLkx6QfxQiOMF6XoIP7O+vRMeunA1Upa9gR3F1Xsi3rBHZOY19HoCWif8dYL35qUmbgR5NdSm9e8AMhlRfkIWdC8/1F6JiMvjlr6PzGK4Xn7JnPa2NnIzxKOejzgKmzDMDG3Bs4bOy3iP+6rsrS4FmGZqBdiPOpGi9Uy4yGn0EAGYTh1eb6wqWEbejYQfwqBaqxCMnssnHKOAwrYugnYh5SsaR4NAA0fv+3Uzr7fbKPAZubXEHhAWtu4MFb88H6Qr+jkJQv22Aj91dyniOG9Qu+Scf5w/NohGHauhPzlNF5LwbWy9hp6vT/SR/n5Ig1RKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JRnKKT0Z1zyFA4p7LYoG+U6K3t2v1Xn5BKeBAEwdg9A=; b=HPiUjLCrfuUzyXm0ORSUz2gN2Hft6RWHioUjLFEQgeAShLf5UFSGP+4BZldVJotgZTYGHVUUzDE47dBWVzTDlPprMMG83Ru423JbiHU2Pvto3H0fl6XPMde9jCTmptanVkn7LMygiukePqPqTqMj6bL8KRF2REZVOYbUmR/9QpQiCg0o4vn+6PYKOOeE6zOizisQTKCVih2WsQ75KFzw98wGNRS6RUCLnXvQOyZHrHcQRNWUaS8xUaR6IkzDGgSXoleaEQwxnQ8fFPl0adgR09USF3J6WjkxX/GjEomNMxLwTcM+n+rCNixEw7AOl2m62MmcjsWlrZlEo5Bli57iCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JRnKKT0Z1zyFA4p7LYoG+U6K3t2v1Xn5BKeBAEwdg9A=; b=qofAl/3Cec0z8TZSHzGjgbMTO9KD3LRJg3+lfpSig6GO2CXerz2t6wDhCdczztcA72moLjWUPWtWojdntNtcc0TcjkXrVILui76Mlns0AONuc/nxsE88oTnp6s+H8nbIgQE3q9YIbogQvABHsZ/hXNph7HOk71NVlZN1qGUy0v0= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by IA0PR10MB6746.namprd10.prod.outlook.com (2603:10b6:208:43e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.17; Sun, 29 Jan 2023 02:43:08 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::560e:9c52:a6bd:4036%9]) with mapi id 15.20.6064.017; Sun, 29 Jan 2023 02:43:08 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: zlang@kernel.org Subject: [PATCH 4/4] fstests: aiodio_sparse2.c, fix compiler warning buffer overflow Date: Sun, 29 Jan 2023 10:42:33 +0800 Message-Id: <54868fe929ac17553747e0eb941192c85b4fe172.1674870429.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0070.apcprd02.prod.outlook.com (2603:1096:4:54::34) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|IA0PR10MB6746:EE_ X-MS-Office365-Filtering-Correlation-Id: 93616692-a24a-4801-4ba6-08db01a28df4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RCk+uvnLpP1ow9DX/DsbGd/W6/tFDy5vGRWE63bFsSYDryanrGx20Y0M0bqETPn0mfDm+jyWJrtMgtkK8XFx2RyTJLgl2pqTQPDbKdIOWFAjr4BihHdvr8P2nujSIyGG+fNsWImUig+uvZDLHzt0DuE0dcpUx5Mu/Bn3fl0Op74S18MDzfZoHPFo5247+E5vvZpWbKdxCGyPSm/LSSBPpO/X4UlLcIe5BK7jwOITJB+mp8QijDjGcyrdKwj2ix9ztiwqM2gMs6oPX9a/CroeBsFEr2m7fau3JwPPPg6fed5PrvLcYf1EQJqQoXKqfMhdoRcPGlIrjNt+FQj31tRduHi6ERYGBAjm59lScL/BWOAPeC0tUM4IzzWRZfjhjvuVp481ifdAWkDzgydaA2FBy5zfgj4s5qFbVfD3zl0UyFdYcis8RfmxvTxiFhjjXWILuBTWTQHKiPz8syWN+2ye4j8YK4/LWdEgTNcNPHCiFbqiVOm/n9cCCTSs1Fl+2gFNAH2iSrQkizgcxc9T8ETsTkH2KeOfWqX+s0YpXeDEurCKLhiabIp0vE5ynPZWDv2t4vEeodjh6mbTKB+OuNahO0GksJ7IoeWkYx65nK34RECZdaUqZYvWqcSNqN0+DO4zULNlJRB/HTnt2oLJyOPTZA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(376002)(39860400002)(346002)(396003)(366004)(136003)(451199018)(6486002)(478600001)(26005)(83380400001)(86362001)(38100700002)(186003)(6512007)(36756003)(2616005)(6666004)(6506007)(4326008)(6916009)(8676002)(66476007)(66946007)(66556008)(4744005)(5660300002)(316002)(8936002)(41300700001)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QBcdUZGJK3nODIfJH9SB3kTUMrfrCYB/Ydj1+Fz7PzHKBBNlK/8cMqPLG2MFG0DHle2QvCE9xRvugvozno5YOVpS5khnbuj7tt+U/fY9uUZWuUqNLFG1ijZgebxDMAztGjYbaen6O+VgcTwzqdT1zKe0PaM2lifDBJXUQY0D3d/3aNsrtyO+WK4DXlne4KYrebcvjZsFZ4ZdgttaudH9SMyBuE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WvFgZswYoIKd2pwDGPV2ZOMKKgz/pf2g26239vvQjZayo6FoTHhCE4dW4J56LSQZ6XHSGo36UVwY3hkd8D6DRL5kYZfmITR2yEq1rq/Atm0nr/2Wu0DXnblnLJJ2U= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93616692-a24a-4801-4ba6-08db01a28df4 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2023 02:43:08.1764 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0CnZyqC68dvTkCnsoyludoX3wTd+988XAa0ObP9SG4BsL8Ov2ljClPxB5tpFT7fsW/Ythnp/T2cNUNZ7VFvL/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6746 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-29_01,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301290025 X-Proofpoint-ORIG-GUID: gxMDh1hL8ZzWCa21z09o6iFbdCUvY8c4 X-Proofpoint-GUID: gxMDh1hL8ZzWCa21z09o6iFbdCUvY8c4 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org The warning is due to 'strncpy' with a maximum number of characters equal to the destination buffer size, without space for null termination. aiodio_sparse2.c: In function 'main': aiodio_sparse2.c:404:9: warning: 'strncpy' specified bound 4096 equals destination size [-Wstringop-truncation] 404 | strncpy(filename, argv[argc-1], PATH_MAX); However, PATH_MAX is including null termination at the end. Anyways, fix warning by setting NULL. Signed-off-by: Anand Jain --- src/aio-dio-regress/aiodio_sparse2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aio-dio-regress/aiodio_sparse2.c b/src/aio-dio-regress/aiodio_sparse2.c index 51ede5bb6c8b..685e3b9dce48 100644 --- a/src/aio-dio-regress/aiodio_sparse2.c +++ b/src/aio-dio-regress/aiodio_sparse2.c @@ -402,6 +402,7 @@ int main(int argc, char **argv) } strncpy(filename, argv[argc-1], PATH_MAX); + filename[PATH_MAX - 1] = '\0'; if (alignment == 0) alignment = get_logical_block_size(filename);