[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 48b3cac0dbcd by Vinay Sajip in branch '3.4':
Fixes #25844: Corrected =/== typo potentially leading to crash in launcher.
https://hg.python.org/cpython/rev/48b3cac0dbcd

--

___
Python tracker 

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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

To the fix for this bug we have to provoke the unsufficient memory error just 
at this point. This is unlikely worth.

Thank you Alexander for your reports.

--
nosy: +serhiy.storchaka
resolution:  -> fixed
stage: test needed -> 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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5015440beec2 by Vinay Sajip in branch '3.4':
Fixes #25844: Corrected =/== typo potentially leading to crash in launcher.
https://hg.python.org/cpython/rev/5015440beec2

New changeset 9552fcd303fd by Vinay Sajip in branch '3.5':
Fixes #25844: Corrected =/== typo potentially leading to crash in launcher.
https://hg.python.org/cpython/rev/9552fcd303fd

New changeset cdf8033d8820 by Vinay Sajip in branch 'default':
Fixes #25844: Merged fix from 3.5.
https://hg.python.org/cpython/rev/cdf8033d8820

--
nosy: +python-dev

___
Python tracker 

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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-12 Thread Brett Cannon

Changes by Brett Cannon :


--
stage:  -> test needed
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-11 Thread Alexander Riccio

New submission from Alexander Riccio:

I found this while writing up a separate bug (CPython doesn't use static 
analysis!).

In PC/launcher.c, get_env has a bug:

/* Large environment variable. Accept some leakage */
wchar_t *buf2 = (wchar_t*)malloc(sizeof(wchar_t) * (result+1));
if (buf2 = NULL) {
error(RC_NO_MEMORY, L"Could not allocate environment buffer");
}
GetEnvironmentVariableW(key, buf2, result);
return buf2;

See: https://hg.python.org/cpython/file/tip/PC/launcher.c#l117


Instead of `buf2 == NULL`, Vinay Sajip wrote `buf2 = NULL`. The commit where 
the error was introduced: https://hg.python.org/cpython/rev/4123e002a1af

Thus, whatever value was in buf2 is lost, the branch is NOT taken (because buf2 
evaluates to false), and GetEnvironmentVariableW will (probably) cause an 
access violation. 


Compiling with /analyze found this quite easily:

c:\pythondev\repo\pc\launcher.c(117): warning C6282: Incorrect operator:  
assignment of constant in Boolean context. Consider using '==' instead.

--
components: Windows
messages: 256254
nosy: Alexander Riccio, paul.moore, steve.dower, tim.golden, vinay.sajip, 
zach.ware
priority: normal
severity: normal
status: open
title: Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing 
against NULL

___
Python tracker 

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



[issue25844] Pylauncher, launcher.c: Assigning NULL to a pointer instead of testing against NULL

2015-12-11 Thread Alexander Riccio

Changes by Alexander Riccio :


--
type:  -> crash

___
Python tracker 

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