From 443060724b85062cbc1f79d4264db4343953d19a Mon Sep 17 00:00:00 2001 From: "k4.rahul" Date: Fri, 5 May 2023 14:24:31 +0530 Subject: [PATCH] Coverity-CWE 22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') Coverity fix for 137960 Filesystem path, filename, or URI manipulation Change-Id: Ieaa291ced268216361d865427100fd48bd39ed5a Signed-off-by: k4.rahul --- osm_lcm/lcm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index 9b62d82..f8a97ae 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -21,6 +21,7 @@ # DEBUG WITH PDB import pdb +import os import asyncio import yaml import logging @@ -880,6 +881,7 @@ if __name__ == "__main__": file=sys.stderr, ) exit(1) + config_file = os.path.realpath(os.path.normpath(os.path.abspath(config_file))) lcm = Lcm(config_file) asyncio.run(lcm.start()) except (LcmException, getopt.GetoptError) as e: -- 2.25.1