python: Fix out of bounds access on unmatched Cython array declaration
This commit is contained in:
parent
0a97439701
commit
99a509de7e
@ -623,9 +623,11 @@ static const char *skipTypeDecl (const char *cp, boolean *is_class)
|
|||||||
/* skip over e.g. 'cpdef numpy.ndarray[dtype=double, ndim=1]' */
|
/* skip over e.g. 'cpdef numpy.ndarray[dtype=double, ndim=1]' */
|
||||||
if(*ptr == '[') {
|
if(*ptr == '[') {
|
||||||
while (*ptr && *ptr != ']') ptr++;
|
while (*ptr && *ptr != ']') ptr++;
|
||||||
}
|
if (*ptr) ptr++;
|
||||||
|
} else {
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!*ptr || *ptr == '=') return NULL;
|
if (!*ptr || *ptr == '=') return NULL;
|
||||||
if (*ptr == '(') {
|
if (*ptr == '(') {
|
||||||
return lastStart; /* if we stopped on a '(' we are done */
|
return lastStart; /* if we stopped on a '(' we are done */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user