Coverity-CWE 22: Improper Limitation of a Pathname to a Restricted Directory ('Path...
[osm/LCM.git] / osm_lcm / lcm.py
index 9b62d82..f8a97ae 100644 (file)
@@ -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: