Add additional check to prevent going before start of buffer (#446)
p is a pointer that iterates over path, which is buffer. We should not try to get to an address preceding its start. Since there was an execution path that leads to that, guard against it with an additional check. Signed-off-by: Alexander Shopov <ash@kambanaria.org> original commit: de8d0e742f44c80735a682bd05019246c2087d56
This commit is contained in:
parent
0df195f066
commit
f3cc313d96
2
LOG
2
LOG
|
@ -1387,3 +1387,5 @@
|
|||
expeditor.ss
|
||||
- fix ee_read_char to handle ^@ properly
|
||||
expeditor.c
|
||||
- prevent access before start of array
|
||||
scheme.c
|
||||
|
|
|
@ -530,7 +530,7 @@ static IBOOL next_path(path, name, ext, sp, dsp) char *path; const char *name, *
|
|||
/* unless entry was null, append name and ext onto path and return true with
|
||||
* updated path, sp, and possibly dsp */
|
||||
if (s != *sp) {
|
||||
if (!DIRMARKERP(*(p - 1))) { setp(PATHSEP); }
|
||||
if ((p > path) && !DIRMARKERP(*(p - 1))) { setp(PATHSEP); }
|
||||
t = name;
|
||||
while (*t != 0) setp(*t++);
|
||||
t = ext;
|
||||
|
|
Loading…
Reference in New Issue
Block a user