Show More
@@ -52,6 +52,7 b' static int _addpath(PyObject *dirs, PyOb' | |||
|
52 | 52 | { |
|
53 | 53 | const char *cpath = PyBytes_AS_STRING(path); |
|
54 | 54 | Py_ssize_t pos = PyBytes_GET_SIZE(path); |
|
55 | Py_ssize_t prev_pos = -1; | |
|
55 | 56 | PyObject *key = NULL; |
|
56 | 57 | int ret = -1; |
|
57 | 58 | |
@@ -64,6 +65,13 b' static int _addpath(PyObject *dirs, PyOb' | |||
|
64 | 65 | * locations, the references are known so these violations should go |
|
65 | 66 | * unnoticed. */ |
|
66 | 67 | while ((pos = _finddir(cpath, pos - 1)) != -1) { |
|
68 | if (pos && prev_pos == pos + 1) { | |
|
69 | PyErr_SetString( | |
|
70 | PyExc_ValueError, | |
|
71 | "invalid empty directory name in dirs.c _addpath"); | |
|
72 | return -1; | |
|
73 | } | |
|
74 | prev_pos = pos; | |
|
67 | 75 | PyObject *val; |
|
68 | 76 | |
|
69 | 77 | key = PyBytes_FromStringAndSize(cpath, pos); |
General Comments 0
You need to be logged in to leave comments.
Login now