[issue34462] _xxsubinterpreters: Wrong NULL check in _copy_raw_string()

2018-08-22 Thread Alexey Izbyshev


New submission from Alexey Izbyshev :

The code at 
https://github.com/python/cpython/blob/28853a249b1d0c890b7e9ca345290bb8c1756446/Modules/_xxsubinterpretersmodule.c#L18
 checks a wrong variable for NULL:

const char *str = PyUnicode_AsUTF8(strobj);
if (str == NULL) {
return NULL;
}
char *copied = PyMem_Malloc(strlen(str)+1);
if (str == NULL) {
PyErr_NoMemory();
return NULL;
}

Reported by Svace static analyzer.

--
components: Extension Modules
messages: 323897
nosy: eric.snow, izbyshev, serhiy.storchaka
priority: normal
severity: normal
status: open
title: _xxsubinterpreters: Wrong NULL check in _copy_raw_string()
type: behavior
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



[issue34462] _xxsubinterpreters: Wrong NULL check in _copy_raw_string()

2018-08-22 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
keywords: +patch
pull_requests: +8337
stage:  -> patch review

___
Python tracker 

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



[issue34462] _xxsubinterpreters: Wrong NULL check in _copy_raw_string()

2018-08-22 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset c583919ffced0a3b6409766fc12f6e28bef4fac7 by Berker Peksag (Alexey 
Izbyshev) in branch 'master':
bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863)
https://github.com/python/cpython/commit/c583919ffced0a3b6409766fc12f6e28bef4fac7


--
nosy: +berker.peksag

___
Python tracker 

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



[issue34462] _xxsubinterpreters: Wrong NULL check in _copy_raw_string()

2018-08-22 Thread Berker Peksag


Change by Berker Peksag :


--
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