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