Fix directory traversal problem in ec.py