Skip to content

Commit

Permalink
Add additional check to prevent going before start of buffer (cisco#446)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alshopov authored and Bob Burger committed Jul 25, 2019
1 parent e962a03 commit de8d0e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions LOG
Original file line number Diff line number Diff line change
Expand Up @@ -1387,3 +1387,5 @@
expeditor.ss
- fix ee_read_char to handle ^@ properly
expeditor.c
- prevent access before start of array
scheme.c
2 changes: 1 addition & 1 deletion c/scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit de8d0e7

Please sign in to comment.