projg2 / python-exec

Wrapper for multi-implementation install of Python scripts and executables
BSD 2-Clause "Simplified" License
13 stars 6 forks source link

Update PATH to include python_impl dependent script path #13

Open pva opened 1 week ago

pva commented 1 week ago

Suggestion to fixes issue #12.

pva commented 1 week ago

Oh, BTW, probably we need to copy env_path to a temporary buffer, otherwise reset will not work. I'll fix this if you agree with a general idea of the patch.

pva commented 1 week ago

python-exec avoids allocating memory by design. Not to mention you don't even check for failed allocations, so you're introducing a vulnerability.

Yea, I've noticed that there are no allocations but I wanted to check that with new path there will be no warning. It worked.

Do you have any idea on how to update env without allocating place to store updated PATH value? Static buffer? I failed to find size for such buffer. It looks like there is no limit on size for env variable value.