[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Charalampos, it's now fixed in 3.9, 3.10 and main branches.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 85b587a38dcf5d0ef1e275510001e22425d65977 by Miss Islington (bot) 
in branch '3.9':
bpo-44285: getpath.c: Assert that env_file is NULL during an error check 
(GH-26486) (GH-26496)
https://github.com/python/cpython/commit/85b587a38dcf5d0ef1e275510001e22425d65977


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread miss-islington


miss-islington  added the comment:


New changeset 0e9af8cae314e4b0e770fe48d5f7b5f540c0b257 by Miss Islington (bot) 
in branch '3.10':
bpo-44285: getpath.c: Assert that env_file is NULL during an error check 
(GH-26486)
https://github.com/python/cpython/commit/0e9af8cae314e4b0e770fe48d5f7b5f540c0b257


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25092
pull_request: https://github.com/python/cpython/pull/26496

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +25091
pull_request: https://github.com/python/cpython/pull/26495

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset bdb56902a3bfe12b10f85a941d5dd0eae739f1a8 by stratakis in branch 
'main':
bpo-44285: getpath.c: Assert that env_file is NULL during an error check 
(GH-26486)
https://github.com/python/cpython/commit/bdb56902a3bfe12b10f85a941d5dd0eae739f1a8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread STINNER Victor


STINNER Victor  added the comment:

I still plan to rewrite getpath.c C file in Python: 
https://bugs.python.org/issue42260 But it's an incompatible change and a low 
priority for me.

--
nosy: +vstinner
versions:  -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread Petr Viktorin


Petr Viktorin  added the comment:

+1, for adding the assertion. It's not trivial to see that env_file must be 
NULL here, even for me (a human).

--
nosy: +petr.viktorin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
keywords: +patch
pull_requests: +25082
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26486

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file".

2021-06-02 Thread Charalampos Stratakis


New submission from Charalampos Stratakis :

This is an issue as it seems with coverity as it's an error case where the file 
was not actually opened. This warning can be silenced and the code be made more 
explicit by adding an assertion.

Python-3.9.1/Modules/getpath.c:1264: alloc_arg: "calculate_open_pyenv" 
allocates memory that is stored into "env_file".
Python-3.9.1/Modules/getpath.c:1266: leaked_storage: Variable "env_file" going 
out of scope leaks the storage it points to.
# 1264|   status = calculate_open_pyenv(calculate, _file);
# 1265|   if (_PyStatus_EXCEPTION(status)) {
# 1266|-> return status;
# 1267|   }
# 1268|   if (env_file == NULL) {

--
messages: 394906
nosy: cstratak
priority: normal
severity: normal
status: open
title: Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates 
memory that is stored into "env_file".
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com