[ python-Bugs-1331563 ] string_subscript doesn't check for failed PyMem_Malloc

SourceForge.net noreply at sourceforge.net
Thu Oct 20 06:16:57 CEST 2005


Bugs item #1331563, was opened at 2005-10-19 05:07
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1331563&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Adam Olsen (rhamphoryncus)
>Assigned to: Neal Norwitz (nnorwitz)
Summary: string_subscript doesn't check for failed PyMem_Malloc

Initial Comment:
result_buf = PyMem_Malloc(slicelength);

for (cur = start, i = 0; i < slicelength; 
    cur += step, i++) {
        result_buf[i] = source_buf[cur];
}

It access result_buf without ever checking if it's NULL.

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2005-10-19 21:16

Message:
Logged In: YES 
user_id=33168

Thanks!

Checked in as:
 * Objects/stringobject.c 2.234, 2.226.2.1

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1331563&group_id=5470


More information about the Python-bugs-list mailing list